diff --git a/.gitmodules b/.gitmodules
index f7632c4abbd..0e4e0b3ed77 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -18,7 +18,23 @@
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
+[submodule "tests/cases/user/prettier/prettier"]
+ path = tests/cases/user/prettier/prettier
+ url = https://github.com/prettier/prettier.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 bda270b0b4c..3eb8736445b 100644
--- a/Jakefile.js
+++ b/Jakefile.js
@@ -491,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/issue_template.md b/issue_template.md
index dc2f223b72e..2e3895d4d7d 100644
--- a/issue_template.md
+++ b/issue_template.md
@@ -24,7 +24,7 @@ Please help us by doing the following steps before logging an issue:
-->
-**TypeScript Version:** 2.7.0-dev.201xxxxx
+**TypeScript Version:** 2.9.0-dev.201xxxxx
**Search Terms:**
diff --git a/package-lock.json b/package-lock.json
index 2e1c6f6207e..265d4233ad8 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -38,7 +38,7 @@
"@types/browserify": {
"version": "12.0.33",
"resolved": "https://registry.npmjs.org/@types/browserify/-/browserify-12.0.33.tgz",
- "integrity": "sha1-5hlxwPmFvx93CQSDJkk/ELDdeL0=",
+ "integrity": "sha512-mY6dYfq1Ns3Xqz/JFUcyoWaXtm0XDoNhkU1vCwM/ULM5zqNL+SbtacJhce/JCgPeCdbqdVqq77tJ4HwdtypSxg==",
"dev": true,
"requires": {
"@types/insert-module-globals": "7.0.0",
@@ -46,21 +46,21 @@
}
},
"@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": {
"version": "1.5.1",
"resolved": "https://registry.npmjs.org/@types/convert-source-map/-/convert-source-map-1.5.1.tgz",
- "integrity": "sha1-1NGA3WrcXLaK2ZvVbgPWN4gfRhY=",
+ "integrity": "sha512-laiDIXqqthjJlyAMYAXOtN3N8+UlbM+KvZi4BaY5ZOekmVkBs/UxfK5O0HWeJVG2eW8F+Mu2ww13fTX+kY1FlQ==",
"dev": true
},
"@types/del": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/@types/del/-/del-3.0.0.tgz",
- "integrity": "sha1-HIzYtuONo7VyNSyo6vVSeTFCYog=",
+ "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"
@@ -86,7 +86,7 @@
"@types/gulp": {
"version": "3.8.36",
"resolved": "https://registry.npmjs.org/@types/gulp/-/gulp-3.8.36.tgz",
- "integrity": "sha1-Eer1g78FNGabT/qb/tUVV/qgCkw=",
+ "integrity": "sha512-u6/zWPzYRNPAtvyFJ3/RSXjmBaBM1dVs5kW22/jU6J786ZGLfSndhLoNOpFI6FGQvqTA+QzFHjSMhpkAN+wxcQ==",
"dev": true,
"requires": {
"@types/node": "8.5.5",
@@ -97,7 +97,7 @@
"@types/gulp-concat": {
"version": "0.0.32",
"resolved": "https://registry.npmjs.org/@types/gulp-concat/-/gulp-concat-0.0.32.tgz",
- "integrity": "sha1-ckhgKLHPX6qUyMHPNMYmUxzsrNY=",
+ "integrity": "sha512-CUCFADlITzzBfBa2bdGzhKtvBr4eFh+evb+4igVbvPoO5RyPfHifmyQlZl6lM7q19+OKncRlFXDU7B4X9Ayo2g==",
"dev": true,
"requires": {
"@types/node": "8.5.5"
@@ -106,7 +106,7 @@
"@types/gulp-help": {
"version": "0.0.34",
"resolved": "https://registry.npmjs.org/@types/gulp-help/-/gulp-help-0.0.34.tgz",
- "integrity": "sha1-Dm1mcYySiWZPLtdaIaDmXXqIM+w=",
+ "integrity": "sha512-MkW7psZznxxJg2MBk2P2qHE+T8jEZVFz3FG/qGjUYazkyJt7hBJWx5Nuewmay5RVNtUvSWPrdZLr/WTXY3T/6A==",
"dev": true,
"requires": {
"@types/gulp": "3.8.36",
@@ -117,7 +117,7 @@
"@types/gulp-newer": {
"version": "0.0.31",
"resolved": "https://registry.npmjs.org/@types/gulp-newer/-/gulp-newer-0.0.31.tgz",
- "integrity": "sha1-818j0eT+DXuP9pnknRwhdmy546c=",
+ "integrity": "sha512-e7J/Zv5Wd7CC0WpuA2syWVitgwrkG0u221e41w7r07XUR6hMH6kHPkq9tUrusHkbeW8QbuLbis5fODOwQCyggQ==",
"dev": true,
"requires": {
"@types/node": "8.5.5"
@@ -126,7 +126,7 @@
"@types/gulp-sourcemaps": {
"version": "0.0.32",
"resolved": "https://registry.npmjs.org/@types/gulp-sourcemaps/-/gulp-sourcemaps-0.0.32.tgz",
- "integrity": "sha1-557mF+DLFXKYdL5FM/5ZwHeToXU=",
+ "integrity": "sha512-+7BAmptW2bxyJnJcCEuie7vLoop3FwWgCdBMzyv7MYXED/HeNMeQuX7uPCkp4vfU1TTu4CYFH0IckNPvo0VePA==",
"dev": true,
"requires": {
"@types/node": "8.5.5"
@@ -135,7 +135,7 @@
"@types/insert-module-globals": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/@types/insert-module-globals/-/insert-module-globals-7.0.0.tgz",
- "integrity": "sha1-jRWN5KY4To2qE7PWPuurbV9nd30=",
+ "integrity": "sha512-zudCJPwluh1VUDB6Gl/OQdRp+fYy3+47huJB/JMQubMS2p+sH18MCVK4WUz3FqaWLB12yh5ELxVR/+tqwlm/qA==",
"dev": true,
"requires": {
"@types/node": "8.5.5"
@@ -144,7 +144,7 @@
"@types/merge2": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/@types/merge2/-/merge2-1.1.4.tgz",
- "integrity": "sha1-CmUOHMIVove4BALqtraiNuYC96M=",
+ "integrity": "sha512-GjaXY4OultxbaOOk7lCLO7xvEcFpdjExC605YmfI6X29vhHKpJfMWKCDZd3x+BITrZaXKg97DgV/SdGVSwdzxA==",
"dev": true,
"requires": {
"@types/node": "8.5.5"
@@ -165,28 +165,28 @@
"@types/mkdirp": {
"version": "0.5.2",
"resolved": "https://registry.npmjs.org/@types/mkdirp/-/mkdirp-0.5.2.tgz",
- "integrity": "sha1-UDqs/lzCcD1UhDJrGyfvpnoznB8=",
+ "integrity": "sha512-U5icWpv7YnZYGsN4/cmh3WD2onMY0aJIiTE6+51TwJCttdHvtCYmkBNOobHlXwrJRL0nkH9jH4kD+1FAdMN4Tg==",
"dev": true,
"requires": {
"@types/node": "8.5.5"
}
},
"@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": {
"version": "8.5.5",
"resolved": "https://registry.npmjs.org/@types/node/-/node-8.5.5.tgz",
- "integrity": "sha1-b56BZK4aVam+sdJXHPt6z51yDGE=",
+ "integrity": "sha512-JRnfoh0Ll4ElmIXKxbUfcOodkGvcNHljct6mO1X9hE/mlrMzAx0hYCLAD7sgT53YAY1HdlpzUcV0CkmDqUqTuA==",
"dev": true
},
"@types/orchestrator": {
"version": "0.3.2",
"resolved": "https://registry.npmjs.org/@types/orchestrator/-/orchestrator-0.3.2.tgz",
- "integrity": "sha1-zRXGzql4oyuY5QVCOcvMeOVWcfE=",
+ "integrity": "sha512-cKB4yTX0wGaRCSkdHDX2fkGQbMAA8UOshC2U7DQky1CE5o+5q2iQQ8VkbPbE/88uaTtsusvBPMcCX7dgmjxBhQ==",
"dev": true,
"requires": {
"@types/node": "8.5.5",
@@ -202,7 +202,7 @@
"@types/run-sequence": {
"version": "0.0.30",
"resolved": "https://registry.npmjs.org/@types/run-sequence/-/run-sequence-0.0.30.tgz",
- "integrity": "sha1-s6kMn9KaXu3lgTXdAl6zrEu7Vg4=",
+ "integrity": "sha512-XwGr1b4yCGUILKeBkzmeWcxmGHQ0vFFFpA6D6y1yLO6gKmYorF+PHqdU5KG+nWt38OvtrkDptmrSmlHX/XtpLw==",
"dev": true,
"requires": {
"@types/gulp": "3.8.36",
@@ -218,10 +218,16 @@
"@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",
- "integrity": "sha1-TzuNro9YKNOADvcJsM/0iO6FLeM=",
+ "integrity": "sha512-2iYpNuOl98SrLPBZfEN9Mh2JCJ2EI9HU35SfgBEb51DcmaHkhp8cKMblYeBqMQiwXMgAD3W60DbQ4i/UdLiXhw==",
"dev": true,
"requires": {
"@types/node": "8.5.5"
@@ -230,7 +236,7 @@
"@types/xml2js": {
"version": "0.4.2",
"resolved": "https://registry.npmjs.org/@types/xml2js/-/xml2js-0.4.2.tgz",
- "integrity": "sha1-pLhLOHn/1HEJU/2Syr/emopOhFY=",
+ "integrity": "sha512-8aKUBSj3oGcnuiBmDLm3BIk09RYg01mz9HlQ2u4aS17oJ25DxjQrEUVGFSBVNOfM45pQW4OjcBPplq6r/exJdA==",
"dev": true,
"requires": {
"@types/node": "8.5.5"
@@ -377,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"
@@ -394,7 +400,7 @@
"arr-flatten": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz",
- "integrity": "sha1-NgSLv/TntH4TZkQxbJlmnqWukfE=",
+ "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==",
"dev": true
},
"arr-union": {
@@ -436,7 +442,7 @@
"array-slice": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/array-slice/-/array-slice-1.1.0.tgz",
- "integrity": "sha1-42jqFfibxwaff/uJrsOmx9SsItQ=",
+ "integrity": "sha512-B1qMD3RBP7O8o0H2KbrXDyB0IccejMF15+87Lvlor12ONPRHP6gTjXMNkt/d3ZuOGbAe66hFmaCfECI24Ufp6w==",
"dev": true
},
"array-union": {
@@ -460,12 +466,6 @@
"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.10.1",
"resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-4.10.1.tgz",
@@ -474,7 +474,7 @@
"requires": {
"bn.js": "4.11.8",
"inherits": "2.0.3",
- "minimalistic-assert": "1.0.0"
+ "minimalistic-assert": "1.0.1"
}
},
"assert": {
@@ -514,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": {
@@ -566,22 +566,62 @@
"base": {
"version": "0.11.2",
"resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz",
- "integrity": "sha1-e95c7RRbbVUakNuH+DxVi060io8=",
+ "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==",
"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.3",
- "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.2.3.tgz",
- "integrity": "sha512-MsAhsUW1GxCdgYSO6tAfZrNapmUKk7mWx/k5mFY/A1gBtkaCaNapTg+FExCw1r9yeaZhqx/xPg43xgTFH6KL5w==",
+ "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": {
@@ -597,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",
@@ -607,22 +647,32 @@
}
},
"braces": {
- "version": "2.3.0",
- "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.0.tgz",
- "integrity": "sha1-pGlBy1+0khVrPWplbgbDU2Tj5m4=",
+ "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": {
@@ -640,7 +690,7 @@
"JSONStream": "1.3.2",
"combine-source-map": "0.8.0",
"defined": "1.0.0",
- "safe-buffer": "5.1.1",
+ "safe-buffer": "5.1.2",
"through2": "2.0.3",
"umd": "3.0.3"
}
@@ -661,9 +711,9 @@
"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",
@@ -698,13 +748,13 @@
"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.8.1",
- "string_decoder": "1.0.3",
+ "string_decoder": "1.1.1",
"subarg": "1.0.0",
"syntax-error": "1.4.0",
"through2": "2.0.3",
@@ -712,7 +762,7 @@
"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"
}
},
@@ -724,27 +774,27 @@
"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.2.0",
- "browserify-des": "1.0.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",
@@ -770,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": {
@@ -792,7 +842,7 @@
"integrity": "sha512-YkIRgwsZwJWTnyQrsBTWefizHh+8GYj3kbL1BTiAQ/9pwpino0G7B2gp5tx/FUBqUlvtxV85KNR3mwfAtv15Yw==",
"dev": true,
"requires": {
- "base64-js": "1.2.3",
+ "base64-js": "1.3.0",
"ieee754": "1.1.11"
}
},
@@ -835,7 +885,7 @@
"cache-base": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz",
- "integrity": "sha1-Cn9GQWgxyLZi7jb+TnxZ129marI=",
+ "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==",
"dev": true,
"requires": {
"collection-visit": "1.0.0",
@@ -871,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": {
@@ -893,18 +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"
+ "supports-color": "5.4.0"
}
},
"check-error": {
@@ -920,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": {
@@ -944,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": "sha1-Nm2CQN3kh8pRgjsaufB6EKeCUco=",
- "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": "sha1-cpyR4thXt6QZofmqZWhcTDP1hF0=",
- "dev": true
}
}
},
@@ -1026,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": {
@@ -1044,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": {
@@ -1082,7 +1065,7 @@
"color-support": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz",
- "integrity": "sha1-k4NDeaHMmgxh+C9S8NBDIiUb1aI=",
+ "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==",
"dev": true
},
"combine-source-map": {
@@ -1131,17 +1114,25 @@
"requires": {
"buffer-from": "1.0.0",
"inherits": "2.0.3",
- "readable-stream": "2.3.3",
+ "readable-stream": "2.3.6",
"typedarray": "0.0.6"
}
},
"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": {
@@ -1178,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",
@@ -1188,28 +1179,29 @@
}
},
"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",
+ "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",
+ "ripemd160": "2.0.2",
+ "safe-buffer": "5.1.2",
"sha.js": "2.4.11"
}
},
@@ -1219,15 +1211,15 @@
"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",
+ "pbkdf2": "3.0.16",
+ "public-encrypt": "4.0.2",
"randombytes": "2.0.6",
"randomfill": "1.0.4"
}
@@ -1303,7 +1295,7 @@
"debug": {
"version": "2.6.9",
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
- "integrity": "sha1-XRKFFd8TT/Mn6QpMk/Tgd6U2NB8=",
+ "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
"dev": true,
"requires": {
"ms": "2.0.0"
@@ -1347,10 +1339,10 @@
"deep-eql": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz",
- "integrity": "sha1-38lARACtHI/gI+faHfHBR8S0RN8=",
+ "integrity": "sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw==",
"dev": true,
"requires": {
- "type-detect": "4.0.5"
+ "type-detect": "4.0.8"
}
},
"deep-is": {
@@ -1365,7 +1357,7 @@
"integrity": "sha1-xlYFHpgX2f8I7YgUd/P+QBnz730=",
"dev": true,
"requires": {
- "clone": "1.0.3"
+ "clone": "1.0.4"
}
},
"define-properties": {
@@ -1379,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": {
@@ -1401,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"
@@ -1432,7 +1456,7 @@
"dev": true,
"requires": {
"inherits": "2.0.3",
- "minimalistic-assert": "1.0.0"
+ "minimalistic-assert": "1.0.1"
}
},
"detect-file": {
@@ -1465,9 +1489,9 @@
"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",
@@ -1487,7 +1511,7 @@
"integrity": "sha1-ixLauHjA1p4+eJEFFmKjL8a93ME=",
"dev": true,
"requires": {
- "readable-stream": "2.3.3"
+ "readable-stream": "2.3.6"
}
},
"duplexify": {
@@ -1498,7 +1522,7 @@
"requires": {
"end-of-stream": "1.4.1",
"inherits": "2.0.3",
- "readable-stream": "2.3.3",
+ "readable-stream": "2.3.6",
"stream-shift": "1.0.0"
},
"dependencies": {
@@ -1524,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"
}
},
@@ -1670,7 +1694,7 @@
"dev": true,
"requires": {
"md5.js": "1.3.4",
- "safe-buffer": "5.1.1"
+ "safe-buffer": "5.1.2"
}
},
"expand-brackets": {
@@ -1683,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": {
@@ -1697,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": "sha1-Nm2CQN3kh8pRgjsaufB6EKeCUco=",
- "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": "sha1-cpyR4thXt6QZofmqZWhcTDP1hF0=",
- "dev": true
}
}
},
@@ -1772,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": "sha1-VeAZ0Mlb+HOUnHN7flFy26hOuyk=",
+ "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",
@@ -1791,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": {
@@ -1841,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": {
@@ -1857,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"
}
},
@@ -1893,7 +1941,7 @@
"dev": true,
"requires": {
"inherits": "2.0.3",
- "readable-stream": "2.3.3"
+ "readable-stream": "2.3.6"
}
},
"for-in": {
@@ -1980,7 +2028,7 @@
"glob": {
"version": "7.1.2",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz",
- "integrity": "sha1-wZyd+aAocC1nhhI4SmVSQExjbRU=",
+ "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==",
"dev": true,
"requires": {
"fs.realpath": "1.0.0",
@@ -2039,7 +2087,7 @@
"integrity": "sha1-jQh8OcazjAAbl/ynzm0OHoCvusc=",
"dev": true,
"requires": {
- "brace-expansion": "1.1.8"
+ "brace-expansion": "1.1.11"
}
},
"readable-stream": {
@@ -2093,11 +2141,11 @@
"global-modules": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/global-modules/-/global-modules-1.0.0.tgz",
- "integrity": "sha1-bXcPDrUjrHgWTXK15xqIdyZcw+o=",
+ "integrity": "sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==",
"dev": true,
"requires": {
"global-prefix": "1.0.2",
- "is-windows": "1.0.1",
+ "is-windows": "1.0.2",
"resolve-dir": "1.0.1"
}
},
@@ -2110,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"
}
},
@@ -2182,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"
@@ -2196,7 +2244,7 @@
"integrity": "sha1-dhPHeKGv6mLyXGMKCG1/Osu92Bg=",
"dev": true,
"requires": {
- "natives": "1.1.1"
+ "natives": "1.1.3"
}
},
"growl": {
@@ -2269,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"
}
@@ -2429,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"
@@ -2456,7 +2504,7 @@
"integrity": "sha1-d8DLN8QVJdZBZtmQ/61+xqDhNj4=",
"dev": true,
"requires": {
- "readable-stream": "2.3.3"
+ "readable-stream": "2.3.6"
}
},
"source-map": {
@@ -2489,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",
@@ -2565,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"
}
@@ -2578,7 +2626,7 @@
"integrity": "sha1-4oxNRdBey77YGDY86PnFkmIp/+U=",
"dev": true,
"requires": {
- "glogg": "1.0.0"
+ "glogg": "1.0.1"
}
},
"handlebars": {
@@ -2682,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": {
@@ -2697,7 +2746,7 @@
"dev": true,
"requires": {
"inherits": "2.0.3",
- "minimalistic-assert": "1.0.0"
+ "minimalistic-assert": "1.0.1"
}
},
"he": {
@@ -2713,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"
}
},
@@ -2744,12 +2793,6 @@
"integrity": "sha512-VhDzCKN7K8ufStx/CLj5/PDTMgph+qwN5Pkd5i0sGnVwk56zJ0lkT8Qzi1xqWLS0Wp29DgDtNeS7v8/wMoZeHg==",
"dev": true
},
- "indexof": {
- "version": "0.0.1",
- "resolved": "https://registry.npmjs.org/indexof/-/indexof-0.0.1.tgz",
- "integrity": "sha1-gtwzbSMrkGIXnQWrMpOmYFn9Q10=",
- "dev": true
- },
"inflight": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
@@ -2769,7 +2812,7 @@
"ini": {
"version": "1.3.5",
"resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz",
- "integrity": "sha1-7uJfVtscnsYIXgwid4CD9Zar+Sc=",
+ "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==",
"dev": true
},
"inline-source-map": {
@@ -2807,46 +2850,76 @@
"is-absolute": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/is-absolute/-/is-absolute-1.0.0.tgz",
- "integrity": "sha1-OV4a6EsR8mrReV5zwXN45IowFXY=",
+ "integrity": "sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA==",
"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": "sha1-FpwvbT3x+ZJhgHI2XJsOofaHhlY=",
+ "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": {
"version": "1.1.6",
"resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz",
- "integrity": "sha1-76ouqdqg16suoTqXsritUf776L4=",
+ "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==",
"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": "sha1-2Eh2Mh0Oet0DmQQGq7u9NrqSaMc=",
+ "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": "sha1-OxWXRqZmBLBPjIFSS6NlxfFNhuw=",
+ "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": {
@@ -2897,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": {
@@ -2912,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"
@@ -2932,7 +3013,7 @@
"is-plain-object": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz",
- "integrity": "sha1-LBY7P6+xtgbZ0Xko8FwqHDjgdnc=",
+ "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==",
"dev": true,
"requires": {
"isobject": "3.0.1"
@@ -2947,7 +3028,7 @@
"is-relative": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/is-relative/-/is-relative-1.0.0.tgz",
- "integrity": "sha1-obtpNc6MXboei5dUubLcwCDiJg0=",
+ "integrity": "sha512-Kw/ReK0iqwKeu0MITLFuj0jbPAmEiOsIwyIXvvbfa6QfmN9pkD1M+8pdk7Rl/dTKbH34/XBFMbgD4iMJhLQbGA==",
"dev": true,
"requires": {
"is-unc-path": "1.0.0"
@@ -2956,7 +3037,7 @@
"is-unc-path": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/is-unc-path/-/is-unc-path-1.0.0.tgz",
- "integrity": "sha1-1zHoiY7QkKEsNSrS6u1Qla0yLJ0=",
+ "integrity": "sha512-mrGpVd0fs7WWLfVsStvgF6iEJnbjDFZh9/emhRDcGWTduTfNHd9CHeUwH3gYIjdbwo4On6hunkztwOaAw0yllQ==",
"dev": true,
"requires": {
"unc-path-regex": "0.1.2"
@@ -2975,9 +3056,9 @@
"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": {
@@ -3010,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",
@@ -3051,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",
@@ -3101,19 +3182,19 @@
"dev": true
},
"js-yaml": {
- "version": "3.10.0",
- "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.10.0.tgz",
- "integrity": "sha1-LnhEFka9RoLpY/IrbpKCPDCcYtw=",
+ "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": {
"esprima": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.0.tgz",
- "integrity": "sha1-RJnt3NERDgshi6zy+n9/WfVcqAQ=",
+ "integrity": "sha512-oftTcaMu/EGrEIu904mWteKIv8vMuOgGYo7EhVJJN00R/EED9DCua/xxHRdYnKtcECzVg7xOWhflvJMnqcFZjw==",
"dev": true
}
}
@@ -3148,7 +3229,7 @@
"kind-of": {
"version": "6.0.2",
"resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz",
- "integrity": "sha1-ARRrNqYhjmTljzqNZt5df8b20FE=",
+ "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==",
"dev": true
},
"labeled-stream-splicer": {
@@ -3171,13 +3252,11 @@
}
},
"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",
@@ -3185,7 +3264,7 @@
"integrity": "sha1-9plf4PggOS9hOWvolGJAe7dxaOQ=",
"dev": true,
"requires": {
- "readable-stream": "2.3.3"
+ "readable-stream": "2.3.6"
}
},
"lead": {
@@ -3384,30 +3463,13 @@
"es5-ext": "0.10.42"
}
},
- "make-error": {
- "version": "1.3.4",
- "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.4.tgz",
- "integrity": "sha512-0Dab5btKVPhibSalc9QGXb559ED7G7iLjFXBaj9Wq8O3vorueR5K5jaE3hkG6ZQINyhA/JgG6Qk4qdFQjsYV6g==",
- "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": {
@@ -3433,18 +3495,6 @@
"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": {
@@ -3470,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": {
@@ -3501,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": {
@@ -3515,10 +3565,10 @@
"minimatch": {
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
- "integrity": "sha1-UWbihkV/AzBgZL5Ul+jbsMPTIIM=",
+ "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
"dev": true,
"requires": {
- "brace-expansion": "1.1.8"
+ "brace-expansion": "1.1.11"
}
},
"minimist": {
@@ -3528,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": "sha1-R6hzK6l3mUV8jB7KKPlRMtfoFQo=",
+ "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",
@@ -3540,7 +3590,7 @@
"is-extendable": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz",
- "integrity": "sha1-p0cPnkJnM9gb2B4RVSZOOjUHyrQ=",
+ "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==",
"dev": true,
"requires": {
"is-plain-object": "2.0.4"
@@ -3566,9 +3616,9 @@
}
},
"mocha": {
- "version": "5.0.5",
- "resolved": "https://registry.npmjs.org/mocha/-/mocha-5.0.5.tgz",
- "integrity": "sha512-3MM3UjZ5p8EJrYpG7s+29HAI9G7sTzKEe4+w37Dg0QP7qL4XGsV+Q2xet2cE37AqdgN1OtYQB6Vl98YiPV3PgA==",
+ "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",
@@ -3579,6 +3629,7 @@
"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"
},
@@ -3630,8 +3681,8 @@
"duplexer2": "0.1.4",
"inherits": "2.0.3",
"parents": "1.0.1",
- "readable-stream": "2.3.3",
- "resolve": "1.6.0",
+ "readable-stream": "2.3.6",
+ "resolve": "1.7.1",
"stream-combiner2": "1.1.1",
"subarg": "1.0.0",
"through2": "2.0.3",
@@ -3639,9 +3690,9 @@
},
"dependencies": {
"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"
@@ -3700,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": "sha1-ARrM4ffL2H97prMJPWzZOSvhxXQ=",
+ "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": {
@@ -3791,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": "sha1-Nm2CQN3kh8pRgjsaufB6EKeCUco=",
- "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": "sha1-cpyR4thXt6QZofmqZWhcTDP1hF0=",
- "dev": true
- }
- }
- },
"kind-of": {
"version": "3.2.2",
"resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
@@ -3885,7 +3892,7 @@
"dev": true,
"requires": {
"for-own": "1.0.0",
- "make-iterator": "1.0.0"
+ "make-iterator": "1.0.1"
}
},
"object.pick": {
@@ -3952,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": {
@@ -3976,7 +3983,7 @@
"p-map": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/p-map/-/p-map-1.2.0.tgz",
- "integrity": "sha1-5OlPMR6rvIYzoeeZCBZfyiYkG2s=",
+ "integrity": "sha512-r6zKACMNhjPJMTl8KcFH4li//gkrXWfbD6feV8l6doRHlzljFWGJ2AP6iKaCJXyZmAUMOPtvbW7EXkbWO/pLEA==",
"dev": true
},
"pako": {
@@ -3995,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.10.1",
"browserify-aes": "1.2.0",
- "create-hash": "1.1.3",
+ "create-hash": "1.2.0",
"evp_bytestokey": "1.0.3",
- "pbkdf2": "3.0.14"
+ "pbkdf2": "3.0.16"
}
},
"parse-filepath": {
@@ -4088,15 +4095,15 @@
"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",
+ "create-hash": "1.2.0",
+ "create-hmac": "1.1.7",
+ "ripemd160": "2.0.2",
+ "safe-buffer": "5.1.2",
"sha.js": "2.4.11"
}
},
@@ -4198,21 +4205,21 @@
"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",
+ "create-hash": "1.2.0",
+ "parse-asn1": "5.1.1",
"randombytes": "2.0.6"
}
},
@@ -4278,7 +4285,7 @@
"integrity": "sha512-CIQ5OFxf4Jou6uOKe9t1AOgqpeU5fd70A8NPdHSGeYXqXsPe6peOwI0cUl88RWZ6sP1vPMV3avd/R6cZ5/sP1A==",
"dev": true,
"requires": {
- "safe-buffer": "5.1.1"
+ "safe-buffer": "5.1.2"
}
},
"randomfill": {
@@ -4288,7 +4295,7 @@
"dev": true,
"requires": {
"randombytes": "2.0.6",
- "safe-buffer": "5.1.1"
+ "safe-buffer": "5.1.2"
}
},
"read-only-stream": {
@@ -4297,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": "sha1-No8lEtefnUb9/HE0mueHi7weuVw=",
+ "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"
}
},
@@ -4325,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": {
@@ -4350,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"
}
},
@@ -4409,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",
@@ -4422,26 +4436,26 @@
"rimraf": {
"version": "2.6.2",
"resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz",
- "integrity": "sha1-LtgVDSShbqhlHm1u8PR8QVjOejY=",
+ "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==",
"dev": true,
"requires": {
"glob": "7.1.2"
}
},
"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"
}
},
"run-sequence": {
"version": "2.2.1",
"resolved": "https://registry.npmjs.org/run-sequence/-/run-sequence-2.2.1.tgz",
- "integrity": "sha1-HOZD2jb9jH6n4akynaM/wriJhJU=",
+ "integrity": "sha512-qkzZnQWMZjcKbh3CNly2srtrkaO/2H/SI5f2eliMCapdRD3UhMrwjfOAZJAnZ2H8Ju4aBzFZkBGXUqFs9V0yxw==",
"dev": true,
"requires": {
"chalk": "1.1.3",
@@ -4477,11 +4491,20 @@
}
},
"safe-buffer": {
- "version": "5.1.1",
- "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz",
- "integrity": "sha1-iTMSr2myEj3vcfV4iQAWce6yyFM=",
+ "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",
@@ -4505,7 +4528,7 @@
"sax": {
"version": "1.2.4",
"resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz",
- "integrity": "sha1-KBYjTiN4vdxOU1T6tcqold9xANk=",
+ "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==",
"dev": true
},
"semver": {
@@ -4520,25 +4543,27 @@
"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",
- "integrity": "sha1-ca5KiPD+77v1LR6mBPP7MV67YnQ=",
+ "integrity": "sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg==",
"dev": true,
"requires": {
"extend-shallow": "2.0.1",
"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": {
@@ -4548,7 +4573,7 @@
"dev": true,
"requires": {
"inherits": "2.0.3",
- "safe-buffer": "5.1.1"
+ "safe-buffer": "5.1.2"
}
},
"shasum": {
@@ -4580,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",
@@ -4592,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": {
@@ -4604,80 +4629,72 @@
"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": "sha1-Nm2CQN3kh8pRgjsaufB6EKeCUco=",
- "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": "sha1-cpyR4thXt6QZofmqZWhcTDP1hF0=",
- "dev": true
}
}
},
"snapdragon-node": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz",
- "integrity": "sha1-bBdfhv8UvbByRWPo88GwIaKGhTs=",
+ "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==",
"dev": true,
"requires": {
"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": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz",
- "integrity": "sha1-+VZHlIbyrNeXAGk/b3uAXkWrVuI=",
+ "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==",
"dev": true,
"requires": {
"kind-of": "3.2.2"
@@ -4703,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": {
@@ -4715,10 +4732,10 @@
"source-map-resolve": {
"version": "0.5.1",
"resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.1.tgz",
- "integrity": "sha1-etD1k/IoFZjoVN+A8ZquS5LXoRo=",
+ "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",
@@ -4726,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": {
@@ -4749,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",
@@ -4766,31 +4781,10 @@
"split-string": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz",
- "integrity": "sha1-fLCd2jqGWFcFxks5pkZgOGguj+I=",
+ "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==",
"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": "sha1-p0cPnkJnM9gb2B4RVSZOOjUHyrQ=",
- "dev": true,
- "requires": {
- "is-plain-object": "2.0.4"
- }
- }
}
},
"sprintf-js": {
@@ -4817,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": "sha1-Nm2CQN3kh8pRgjsaufB6EKeCUco=",
- "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": "sha1-cpyR4thXt6QZofmqZWhcTDP1hF0=",
- "dev": true
}
}
},
@@ -4884,7 +4821,7 @@
"dev": true,
"requires": {
"inherits": "2.0.3",
- "readable-stream": "2.3.3"
+ "readable-stream": "2.3.6"
}
},
"stream-combiner2": {
@@ -4894,13 +4831,13 @@
"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": {
@@ -4911,7 +4848,7 @@
"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"
}
@@ -4929,7 +4866,7 @@
"dev": true,
"requires": {
"inherits": "2.0.3",
- "readable-stream": "2.3.3"
+ "readable-stream": "2.3.6"
}
},
"streamqueue": {
@@ -4968,12 +4905,12 @@
}
},
"string_decoder": {
- "version": "1.0.3",
- "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz",
- "integrity": "sha1-D8Z9fBQYJd6UKC3VNr7GubzoYKs=",
+ "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": {
@@ -5011,9 +4948,9 @@
}
},
"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==",
+ "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": {
"has-flag": "3.0.0"
@@ -5040,7 +4977,7 @@
"integrity": "sha1-AARWmzfHx0ujnEPzzteNGtlBQL4=",
"dev": true,
"requires": {
- "readable-stream": "2.3.3",
+ "readable-stream": "2.3.6",
"xtend": "4.0.1"
}
},
@@ -5125,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": "sha1-Nm2CQN3kh8pRgjsaufB6EKeCUco=",
- "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": "sha1-cpyR4thXt6QZofmqZWhcTDP1hF0=",
- "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": {
@@ -5228,22 +5098,6 @@
"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.5.0",
- "make-error": "1.3.4",
- "minimist": "1.2.0",
- "mkdirp": "0.5.1",
- "source-map-support": "0.5.4",
- "yn": "2.0.0"
- }
- },
"tslib": {
"version": "1.9.0",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.0.tgz",
@@ -5258,13 +5112,13 @@
"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.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.9.0",
"tsutils": "2.26.1"
@@ -5277,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"
@@ -5318,9 +5172,9 @@
}
},
"type-detect": {
- "version": "4.0.5",
- "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.5.tgz",
- "integrity": "sha1-1w5byB223io4G8rKDG4MvcdjXeI=",
+ "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": {
@@ -5330,9 +5184,9 @@
"dev": true
},
"typescript": {
- "version": "2.9.0-dev.20180407",
- "resolved": "https://registry.npmjs.org/typescript/-/typescript-2.9.0-dev.20180407.tgz",
- "integrity": "sha512-Tg0/hU2hSz+4pb5Lj5+bj1uLldN7C8NO5Ik19WfftMlpeXRyZQJzglV0oncmsXOfN9gG+JC0xnO58YspE6sZ1w==",
+ "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": {
@@ -5378,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",
@@ -5463,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": "sha1-Nm2CQN3kh8pRgjsaufB6EKeCUco=",
- "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": "sha1-cpyR4thXt6QZofmqZWhcTDP1hF0=",
- "dev": true
- }
+ "kind-of": "6.0.2"
}
},
"user-home": {
@@ -5600,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"
},
@@ -5716,25 +5509,16 @@
}
}
},
- "vlq": {
- "version": "0.2.3",
- "resolved": "https://registry.npmjs.org/vlq/-/vlq-0.2.3.tgz",
- "integrity": "sha1-jz5DKM9jsVQMDWfhsneDhviXWyY=",
- "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",
"resolved": "https://registry.npmjs.org/which/-/which-1.3.0.tgz",
- "integrity": "sha1-/wS9/AEO5UfXgL7DjhrBwnd9JTo=",
+ "integrity": "sha512-xcJpopdamTuY5duC/KnTTNBraPK54YwpenP4lzxU8H91GudWpFv38u0CKjclE1Wi2EH2EDz5LRcHcKbCIzqGyg==",
"dev": true,
"requires": {
"isexe": "2.0.0"
@@ -5762,17 +5546,17 @@
"xml2js": {
"version": "0.4.19",
"resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.19.tgz",
- "integrity": "sha1-aGwg8hMgnpSr8NG88e+qKRx4J6c=",
+ "integrity": "sha512-esZnJZJOiJR9wWKMyuvSE1y6Dq5LCuJanqhxslH2bxM6duahNZ+HMpCLhBQGZkbX6xRf8x1Y2eJlgt2q3qo49Q==",
"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": {
@@ -5793,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/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 12dbd2e42d4..016434f4628 100644
--- a/src/compiler/binder.ts
+++ b/src/compiler/binder.ts
@@ -520,8 +520,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 };
@@ -2230,14 +2231,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;
@@ -2332,7 +2333,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 92e651061ed..6dd3226e550 100644
--- a/src/compiler/builder.ts
+++ b/src/compiler/builder.ts
@@ -249,7 +249,7 @@ namespace ts {
export function createBuilderProgram(kind: BuilderProgramKind, { newProgram, host, oldProgram, configFileParsingDiagnostics }: BuilderCreationParameters) {
// Return same program if underlying program doesnt change
let oldState = oldProgram && oldProgram.getState();
- if (oldState && newProgram === oldState.program && configFileParsingDiagnostics !== newProgram.getConfigFileParsingDiagnostics()) {
+ if (oldState && newProgram === oldState.program && configFileParsingDiagnostics === newProgram.getConfigFileParsingDiagnostics()) {
newProgram = undefined;
oldState = undefined;
return oldProgram;
diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts
index e310e5f1f21..f17ecf924a6 100644
--- a/src/compiler/checker.ts
+++ b/src/compiler/checker.ts
@@ -60,13 +60,14 @@ namespace ts {
const compilerOptions = host.getCompilerOptions();
const languageVersion = getEmitScriptTarget(compilerOptions);
- const modulekind = getEmitModuleKind(compilerOptions);
+ const moduleKind = getEmitModuleKind(compilerOptions);
const allowSyntheticDefaultImports = getAllowSyntheticDefaultImports(compilerOptions);
const strictNullChecks = getStrictOptionValue(compilerOptions, "strictNullChecks");
const strictFunctionTypes = getStrictOptionValue(compilerOptions, "strictFunctionTypes");
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();
@@ -324,6 +325,16 @@ namespace ts {
return diagnostics;
}
},
+
+ runWithCancellationToken: (token, callback) => {
+ try {
+ cancellationToken = token;
+ return callback(checker);
+ }
+ finally {
+ cancellationToken = undefined;
+ }
+ }
};
const tupleTypes: GenericType[] = [];
@@ -356,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);
@@ -430,6 +443,8 @@ namespace ts {
let deferredGlobalAsyncIteratorType: GenericType;
let deferredGlobalAsyncIterableIteratorType: GenericType;
let deferredGlobalTemplateStringsArrayType: ObjectType;
+ let deferredGlobalImportMetaType: ObjectType;
+ let deferredGlobalExtractSymbol: Symbol;
let deferredNodes: Node[];
const allPotentiallyUnusedIdentifiers = createMap>(); // key is file name
@@ -603,22 +618,6 @@ namespace ts {
Both = Source | Target,
}
- const enum TypeIncludes {
- Any = 1 << 0,
- Undefined = 1 << 1,
- Null = 1 << 2,
- Never = 1 << 3,
- NonWideningType = 1 << 4,
- String = 1 << 5,
- Number = 1 << 6,
- ESSymbol = 1 << 7,
- LiteralOrUniqueESSymbol = 1 << 8,
- ObjectType = 1 << 9,
- EmptyObject = 1 << 10,
- Union = 1 << 11,
- Wildcard = 1 << 12,
- }
-
const enum MembersOrExportsResolutionKind {
resolvedExports = "resolvedExports",
resolvedMembers = "resolvedMembers"
@@ -1080,7 +1079,7 @@ namespace ts {
const declarationFile = getSourceFileOfNode(declaration);
const useFile = getSourceFileOfNode(usage);
if (declarationFile !== useFile) {
- if ((modulekind && (declarationFile.externalModuleIndicator || useFile.externalModuleIndicator)) ||
+ if ((moduleKind && (declarationFile.externalModuleIndicator || useFile.externalModuleIndicator)) ||
(!compilerOptions.outFile && !compilerOptions.out) ||
isInTypeQuery(usage) ||
declaration.flags & NodeFlags.Ambient) {
@@ -1554,7 +1553,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;
}
}
@@ -1567,7 +1567,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)) {
@@ -1840,7 +1840,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;
@@ -1875,7 +1875,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 {
@@ -1888,7 +1888,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) {
@@ -1921,13 +1921,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 {
@@ -1943,7 +1947,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);
}
@@ -2060,10 +2065,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) {
@@ -2114,6 +2119,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);
}
@@ -2212,20 +2237,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;
}
@@ -2958,6 +2991,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;
@@ -3846,10 +3882,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);
@@ -4126,7 +4165,7 @@ namespace ts {
const isPrivate = getDeclarationModifierFlagsFromSymbol(prop) & (ModifierFlags.Private | ModifierFlags.Protected);
const isSetOnlyAccessor = prop.flags & SymbolFlags.SetAccessor && !(prop.flags & SymbolFlags.GetAccessor);
if (!inNamesToRemove && !isPrivate && !isClassMethod(prop) && !isSetOnlyAccessor) {
- members.set(prop.escapedName, prop);
+ members.set(prop.escapedName, getNonReadonlySymbol(prop));
}
}
const stringIndexInfo = getIndexInfoOfType(source, IndexKind.String);
@@ -4173,12 +4212,29 @@ namespace ts {
const isLate = isLateBindableName(name);
const isWellKnown = isComputedPropertyName(name) && isWellKnownSymbolSyntactically(name.expression);
if (!isLate && !isWellKnown && isComputedNonLiteralName(name)) {
- return anyType;
+ const exprType = checkExpression((name as ComputedPropertyName).expression);
+ if (isTypeAssignableToKind(exprType, TypeFlags.ESSymbolLike)) {
+ if (noImplicitAny) {
+ error(declaration, Diagnostics.Type_0_cannot_be_used_to_index_type_1, typeToString(exprType), typeToString(parentType));
+ }
+ return anyType;
+ }
+ const indexerType = isTypeAssignableToKind(exprType, TypeFlags.NumberLike) && getIndexTypeOfType(parentType, IndexKind.Number) || getIndexTypeOfType(parentType, IndexKind.String);
+ if (!indexerType && noImplicitAny && !compilerOptions.suppressImplicitAnyIndexErrors) {
+ if (getIndexTypeOfType(parentType, IndexKind.Number)) {
+ error(declaration, Diagnostics.Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number);
+ }
+ else {
+ error(declaration, Diagnostics.Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature, typeToString(parentType));
+ }
+ }
+ return indexerType || 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 = isLate ? getLateBoundNameFromType(checkComputedPropertyName(name as ComputedPropertyName) as LiteralType | UniqueESSymbolType) :
+ const nameType = isLate && checkComputedPropertyName(name as ComputedPropertyName) as LiteralType | UniqueESSymbolType;
+ const text = isLate ? getLateBoundNameFromType(nameType) :
isWellKnown ? getPropertyNameForKnownSymbolName(idText(((name as ComputedPropertyName).expression as PropertyAccessExpression).name)) :
getTextOfPropertyName(name);
@@ -4186,6 +4242,12 @@ namespace ts {
if (strictNullChecks && declaration.flags & NodeFlags.Ambient && isParameterDeclaration(declaration)) {
parentType = getNonNullableType(parentType);
}
+ if (isLate && nameType && !getPropertyOfType(parentType, text) && isTypeAssignableToKind(nameType, TypeFlags.ESSymbolLike)) {
+ if (noImplicitAny) {
+ error(declaration, Diagnostics.Type_0_cannot_be_used_to_index_type_1, typeToString(nameType), typeToString(parentType));
+ }
+ return anyType;
+ }
const declaredType = getConstraintForLocation(getTypeOfPropertyOfType(parentType, text), declaration.name);
type = declaredType && getFlowTypeOfReference(declaration, declaredType) ||
isNumericLiteralName(text) && getIndexTypeOfType(parentType, IndexKind.Number) ||
@@ -4260,7 +4322,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) {
@@ -4376,7 +4438,7 @@ namespace ts {
const special = getSpecialPropertyAssignmentKind(expression);
if (special === SpecialPropertyAssignmentKind.ThisProperty) {
const thisContainer = getThisContainer(expression, /*includeArrowFunctions*/ false);
- // Properties defined in a constructor (or javascript constructor function) don't get undefined added.
+ // Properties defined in a constructor (or base constructor, or javascript constructor function) don't get undefined added.
// Function expressions that are assigned to the prototype count as methods.
declarationInConstructor = thisContainer.kind === SyntaxKind.Constructor ||
thisContainer.kind === SyntaxKind.FunctionDeclaration ||
@@ -4446,7 +4508,14 @@ namespace ts {
}
let type = jsDocType;
if (!type) {
- // use only the constructor types unless only null | undefined (including widening variants) were assigned there
+ // use only the constructor types unless they were only assigned null | undefined (including widening variants)
+ if (definedInMethod) {
+ const propType = getTypeOfSpecialPropertyOfBaseType(symbol);
+ if (propType) {
+ (constructorTypes || (constructorTypes = [])).push(propType);
+ definedInConstructor = true;
+ }
+ }
const sourceTypes = some(constructorTypes, t => !!(t.flags & ~(TypeFlags.Nullable | TypeFlags.ContainsWideningType))) ? constructorTypes : types;
type = getUnionType(sourceTypes, UnionReduction.Subtype);
}
@@ -4460,6 +4529,20 @@ namespace ts {
return widened;
}
+ /** check for definition in base class if any declaration is in a class */
+ function getTypeOfSpecialPropertyOfBaseType(specialProperty: Symbol) {
+ const parentDeclaration = forEach(specialProperty.declarations, d => {
+ const parent = getThisContainer(d, /*includeArrowFunctions*/ false).parent;
+ return isClassLike(parent) && parent;
+ });
+ if (parentDeclaration) {
+ const classType = getDeclaredTypeOfSymbol(getSymbolOfNode(parentDeclaration)) as InterfaceType;
+ const baseClassType = classType && getBaseTypes(classType)[0];
+ if (baseClassType) {
+ return getTypeOfPropertyOfType(baseClassType, specialProperty.escapedName);
+ }
+ }
+ }
// Return the type implied by a binding pattern element. This is the type of the initializer of the element if
// one is present. Otherwise, if the element is itself a binding pattern, it is the type implied by the binding
@@ -4902,8 +4985,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;
}
@@ -4963,8 +5045,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);
}
}
}
@@ -5282,6 +5365,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) {
@@ -5296,6 +5389,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;
}
@@ -5460,9 +5555,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));
}
/**
@@ -5656,13 +5752,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");
@@ -6094,6 +6184,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);
@@ -6105,6 +6196,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,
@@ -6115,15 +6207,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,
@@ -6133,16 +6229,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.
@@ -6150,8 +6239,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);
@@ -6164,9 +6253,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);
@@ -6174,6 +6263,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));
+ }
}
}
@@ -6353,18 +6445,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) {
@@ -6399,6 +6483,47 @@ namespace ts {
return getConstraintOfDistributiveConditionalType(type) || getDefaultConstraintOfConditionalType(type);
}
+ function getUnionConstraintOfIntersection(type: IntersectionType, targetIsUnion: boolean) {
+ let constraints: Type[];
+ let hasDisjointDomainType = false;
+ for (const t of type.types) {
+ if (t.flags & TypeFlags.Instantiable) {
+ // We keep following constraints as long as we have an instantiable type that is known
+ // not to be circular or infinite (hence we stop on index access types).
+ let constraint = getConstraintOfType(t);
+ while (constraint && constraint.flags & (TypeFlags.TypeParameter | TypeFlags.Index | TypeFlags.Conditional)) {
+ constraint = getConstraintOfType(constraint);
+ }
+ if (constraint) {
+ // A constraint that isn't a union type implies that the final type would be a non-union
+ // type as well. Since non-union constraints are of no interest, we can exit here.
+ if (!(constraint.flags & TypeFlags.Union)) {
+ return undefined;
+ }
+ constraints = append(constraints, constraint);
+ }
+ }
+ else if (t.flags & TypeFlags.DisjointDomains) {
+ hasDisjointDomainType = true;
+ }
+ }
+ // If the target is a union type or if we are intersecting with types belonging to one of the
+ // disjoint domans, we may end up producing a constraint that hasn't been examined before.
+ if (constraints && (targetIsUnion || hasDisjointDomainType)) {
+ if (hasDisjointDomainType) {
+ // We add any types belong to one of the disjoint domans because they might cause the final
+ // intersection operation to reduce the union constraints.
+ for (const t of type.types) {
+ if (t.flags & TypeFlags.DisjointDomains) {
+ constraints = append(constraints, t);
+ }
+ }
+ }
+ return getIntersectionType(constraints);
+ }
+ return undefined;
+ }
+
function getBaseConstraintOfInstantiableNonPrimitiveUnionOrIntersection(type: Type) {
if (type.flags & (TypeFlags.InstantiableNonPrimitive | TypeFlags.UnionOrIntersection)) {
const constraint = getResolvedBaseConstraint(type);
@@ -6411,7 +6536,7 @@ namespace ts {
function getBaseConstraintOfType(type: Type): Type {
const constraint = getBaseConstraintOfInstantiableNonPrimitiveUnionOrIntersection(type);
if (!constraint && type.flags & TypeFlags.Index) {
- return stringType;
+ return keyofConstraintType;
}
return constraint;
}
@@ -6446,7 +6571,7 @@ namespace ts {
circular = true;
return undefined;
}
- const result = computeBaseConstraint(t);
+ const result = computeBaseConstraint(getSimplifiedType(t));
if (!popTypeResolution()) {
circular = true;
return undefined;
@@ -6475,13 +6600,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;
@@ -6565,6 +6686,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;
}
@@ -6604,25 +6726,41 @@ 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;
+ let commonValueDeclaration: Declaration;
+ let hasNonUniformValueDeclaration = false;
for (const prop of props) {
- if (prop.declarations) {
- addRange(declarations, prop.declarations);
+ if (!commonValueDeclaration) {
+ commonValueDeclaration = prop.valueDeclaration;
}
+ else if (prop.valueDeclaration !== commonValueDeclaration) {
+ hasNonUniformValueDeclaration = true;
+ }
+ 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;
+ if (!hasNonUniformValueDeclaration && commonValueDeclaration) {
+ result.valueDeclaration = commonValueDeclaration;
+ }
result.declarations = declarations;
+ result.nameType = nameType;
result.type = isUnion ? getUnionType(propTypes) : getIntersectionType(propTypes);
return result;
}
@@ -6740,8 +6878,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;
}
@@ -7245,7 +7382,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) {
@@ -7552,7 +7690,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;
}
@@ -7712,6 +7850,10 @@ namespace ts {
return deferredGlobalTemplateStringsArrayType || (deferredGlobalTemplateStringsArrayType = getGlobalType("TemplateStringsArray" as __String, /*arity*/ 0, /*reportErrors*/ true)) || emptyObjectType;
}
+ function getGlobalImportMetaType() {
+ return deferredGlobalImportMetaType || (deferredGlobalImportMetaType = getGlobalType("ImportMeta" as __String, /*arity*/ 0, /*reportErrors*/ true)) || emptyObjectType;
+ }
+
function getGlobalESSymbolConstructorSymbol(reportErrors: boolean) {
return deferredGlobalESSymbolConstructorSymbol || (deferredGlobalESSymbolConstructorSymbol = getGlobalValueSymbol("Symbol" as __String, reportErrors));
}
@@ -7761,6 +7903,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.
*/
@@ -7863,8 +8009,14 @@ namespace ts {
return binarySearch(types, type, getTypeId, compareValues) >= 0;
}
- // Return true if the given intersection type contains (a) more than one unit type or (b) an object
- // type and a nullable type (null or undefined).
+ // Return true if the given intersection type contains
+ // more than one unit type or,
+ // an object type and a nullable type (null or undefined), or
+ // a string-like type and a type known to be non-string-like, or
+ // a number-like type and a type known to be non-number-like, or
+ // a symbol-like type and a type known to be non-symbol-like, or
+ // a void-like type and a type known to be non-void-like, or
+ // a non-primitive type and a type known to be primitive.
function isEmptyIntersectionType(type: IntersectionType) {
let combined: TypeFlags = 0;
for (const t of type.types) {
@@ -7872,42 +8024,43 @@ namespace ts {
return true;
}
combined |= t.flags;
- if (combined & TypeFlags.Nullable && combined & (TypeFlags.Object | TypeFlags.NonPrimitive)) {
+ if (combined & TypeFlags.Nullable && combined & (TypeFlags.Object | TypeFlags.NonPrimitive) ||
+ combined & TypeFlags.NonPrimitive && combined & (TypeFlags.DisjointDomains & ~TypeFlags.NonPrimitive) ||
+ combined & TypeFlags.StringLike && combined & (TypeFlags.DisjointDomains & ~TypeFlags.StringLike) ||
+ combined & TypeFlags.NumberLike && combined & (TypeFlags.DisjointDomains & ~TypeFlags.NumberLike) ||
+ combined & TypeFlags.ESSymbolLike && combined & (TypeFlags.DisjointDomains & ~TypeFlags.ESSymbolLike) ||
+ combined & TypeFlags.VoidLike && combined & (TypeFlags.DisjointDomains & ~TypeFlags.VoidLike)) {
return true;
}
}
return false;
}
- function addTypeToUnion(typeSet: Type[], includes: TypeIncludes, type: Type) {
+ function addTypeToUnion(typeSet: Type[], includes: TypeFlags, type: Type) {
const flags = type.flags;
if (flags & TypeFlags.Union) {
- includes = addTypesToUnion(typeSet, includes, (type).types);
+ return addTypesToUnion(typeSet, includes, (type).types);
}
- else if (flags & TypeFlags.Any) {
- includes |= TypeIncludes.Any;
- if (type === wildcardType) includes |= TypeIncludes.Wildcard;
- }
- else if (!strictNullChecks && flags & TypeFlags.Nullable) {
- if (flags & TypeFlags.Undefined) includes |= TypeIncludes.Undefined;
- if (flags & TypeFlags.Null) includes |= TypeIncludes.Null;
- if (!(flags & TypeFlags.ContainsWideningType)) includes |= TypeIncludes.NonWideningType;
- }
- else if (!(flags & TypeFlags.Never || flags & TypeFlags.Intersection && isEmptyIntersectionType(type))) {
- // We ignore 'never' types in unions. Likewise, we ignore intersections of unit types as they are
- // another form of 'never' (in that they have an empty value domain). We could in theory turn
- // intersections of unit types into 'never' upon construction, but deferring the reduction makes it
- // easier to reason about their origin.
- if (flags & TypeFlags.String) includes |= TypeIncludes.String;
- if (flags & TypeFlags.Number) includes |= TypeIncludes.Number;
- if (flags & TypeFlags.ESSymbol) includes |= TypeIncludes.ESSymbol;
- if (flags & TypeFlags.StringOrNumberLiteralOrUnique) includes |= TypeIncludes.LiteralOrUniqueESSymbol;
- const len = typeSet.length;
- const index = len && type.id > typeSet[len - 1].id ? ~len : binarySearch(typeSet, type, getTypeId, compareValues);
- if (index < 0) {
- if (!(flags & TypeFlags.Object && (type).objectFlags & ObjectFlags.Anonymous &&
- type.symbol && type.symbol.flags & (SymbolFlags.Function | SymbolFlags.Method) && containsIdenticalType(typeSet, type))) {
- typeSet.splice(~index, 0, type);
+ // We ignore 'never' types in unions. Likewise, we ignore intersections of unit types as they are
+ // another form of 'never' (in that they have an empty value domain). We could in theory turn
+ // intersections of unit types into 'never' upon construction, but deferring the reduction makes it
+ // easier to reason about their origin.
+ if (!(flags & TypeFlags.Never || flags & TypeFlags.Intersection && isEmptyIntersectionType(type))) {
+ includes |= flags & ~TypeFlags.ConstructionFlags;
+ if (flags & TypeFlags.Any) {
+ if (type === wildcardType) includes |= TypeFlags.Wildcard;
+ }
+ else if (!strictNullChecks && flags & TypeFlags.Nullable) {
+ if (!(flags & TypeFlags.ContainsWideningType)) includes |= TypeFlags.NonWideningType;
+ }
+ else {
+ const len = typeSet.length;
+ const index = len && type.id > typeSet[len - 1].id ? ~len : binarySearch(typeSet, type, getTypeId, compareValues);
+ if (index < 0) {
+ if (!(flags & TypeFlags.Object && (type).objectFlags & ObjectFlags.Anonymous &&
+ type.symbol && type.symbol.flags & (SymbolFlags.Function | SymbolFlags.Method) && containsIdenticalType(typeSet, type))) {
+ typeSet.splice(~index, 0, type);
+ }
}
}
}
@@ -7916,7 +8069,7 @@ namespace ts {
// Add the given types to the given type set. Order is preserved, duplicates are removed,
// and nested types of the given kind are flattened into the set.
- function addTypesToUnion(typeSet: Type[], includes: TypeIncludes, types: Type[]): TypeIncludes {
+ function addTypesToUnion(typeSet: Type[], includes: TypeFlags, types: Type[]): TypeFlags {
for (const type of types) {
includes = addTypeToUnion(typeSet, includes, type);
}
@@ -7973,15 +8126,15 @@ namespace ts {
}
}
- function removeRedundantLiteralTypes(types: Type[], includes: TypeIncludes) {
+ function removeRedundantLiteralTypes(types: Type[], includes: TypeFlags) {
let i = types.length;
while (i > 0) {
i--;
const t = types[i];
const remove =
- t.flags & TypeFlags.StringLiteral && includes & TypeIncludes.String ||
- t.flags & TypeFlags.NumberLiteral && includes & TypeIncludes.Number ||
- t.flags & TypeFlags.UniqueESSymbol && includes & TypeIncludes.ESSymbol ||
+ t.flags & TypeFlags.StringLiteral && includes & TypeFlags.String ||
+ t.flags & TypeFlags.NumberLiteral && includes & TypeFlags.Number ||
+ t.flags & TypeFlags.UniqueESSymbol && includes & TypeFlags.ESSymbol ||
t.flags & TypeFlags.StringOrNumberLiteral && t.flags & TypeFlags.FreshLiteral && containsType(types, (t).regularType);
if (remove) {
orderedRemoveItemAt(types, i);
@@ -8005,12 +8158,12 @@ namespace ts {
}
const typeSet: Type[] = [];
const includes = addTypesToUnion(typeSet, 0, types);
- if (includes & TypeIncludes.Any) {
- return includes & TypeIncludes.Wildcard ? wildcardType : anyType;
+ if (includes & TypeFlags.Any) {
+ return includes & TypeFlags.Wildcard ? wildcardType : anyType;
}
switch (unionReduction) {
case UnionReduction.Literal:
- if (includes & TypeIncludes.LiteralOrUniqueESSymbol) {
+ if (includes & TypeFlags.StringOrNumberLiteralOrUnique) {
removeRedundantLiteralTypes(typeSet, includes);
}
break;
@@ -8019,8 +8172,8 @@ namespace ts {
break;
}
if (typeSet.length === 0) {
- return includes & TypeIncludes.Null ? includes & TypeIncludes.NonWideningType ? nullType : nullWideningType :
- includes & TypeIncludes.Undefined ? includes & TypeIncludes.NonWideningType ? undefinedType : undefinedWideningType :
+ return includes & TypeFlags.Null ? includes & TypeFlags.NonWideningType ? nullType : nullWideningType :
+ includes & TypeFlags.Undefined ? includes & TypeFlags.NonWideningType ? undefinedType : undefinedWideningType :
neverType;
}
return getUnionTypeFromSortedList(typeSet, aliasSymbol, aliasTypeArguments);
@@ -8098,30 +8251,23 @@ namespace ts {
return links.resolvedType;
}
- function addTypeToIntersection(typeSet: Type[], includes: TypeIncludes, type: Type) {
+ function addTypeToIntersection(typeSet: Type[], includes: TypeFlags, type: Type) {
const flags = type.flags;
if (flags & TypeFlags.Intersection) {
- includes = addTypesToIntersection(typeSet, includes, (type).types);
+ return addTypesToIntersection(typeSet, includes, (type).types);
}
- else if (flags & TypeFlags.Any) {
- includes |= TypeIncludes.Any;
- if (type === wildcardType) includes |= TypeIncludes.Wildcard;
+ if (getObjectFlags(type) & ObjectFlags.Anonymous && isEmptyObjectType(type)) {
+ includes |= TypeFlags.EmptyObject;
}
- else if (flags & TypeFlags.Never) {
- includes |= TypeIncludes.Never;
- }
- else if (getObjectFlags(type) & ObjectFlags.Anonymous && isEmptyObjectType(type)) {
- includes |= TypeIncludes.EmptyObject;
- }
- else if ((strictNullChecks || !(flags & TypeFlags.Nullable)) && !contains(typeSet, type)) {
- if (flags & TypeFlags.Object) {
- includes |= TypeIncludes.ObjectType;
+ else {
+ includes |= flags & ~TypeFlags.ConstructionFlags;
+ if (flags & TypeFlags.Any) {
+ if (type === wildcardType) includes |= TypeFlags.Wildcard;
}
- if (flags & TypeFlags.Union) {
- includes |= TypeIncludes.Union;
- }
- if (!(flags & TypeFlags.Object && (type).objectFlags & ObjectFlags.Anonymous &&
- type.symbol && type.symbol.flags & (SymbolFlags.Function | SymbolFlags.Method) && containsIdenticalType(typeSet, type))) {
+ else if ((strictNullChecks || !(flags & TypeFlags.Nullable)) && !contains(typeSet, type) &&
+ !(flags & TypeFlags.Object && (type).objectFlags & ObjectFlags.Anonymous &&
+ type.symbol && type.symbol.flags & (SymbolFlags.Function | SymbolFlags.Method) &&
+ containsIdenticalType(typeSet, type))) {
typeSet.push(type);
}
}
@@ -8130,13 +8276,28 @@ namespace ts {
// Add the given types to the given type set. Order is preserved, freshness is removed from literal
// types, duplicates are removed, and nested types of the given kind are flattened into the set.
- function addTypesToIntersection(typeSet: Type[], includes: TypeIncludes, types: Type[]) {
+ function addTypesToIntersection(typeSet: Type[], includes: TypeFlags, types: Type[]) {
for (const type of types) {
includes = addTypeToIntersection(typeSet, includes, getRegularTypeOfLiteralType(type));
}
return includes;
}
+ function removeRedundantPrimitiveTypes(types: Type[], includes: TypeFlags) {
+ let i = types.length;
+ while (i > 0) {
+ i--;
+ const t = types[i];
+ const remove =
+ t.flags & TypeFlags.String && includes & TypeFlags.StringLiteral ||
+ t.flags & TypeFlags.Number && includes & TypeFlags.NumberLiteral ||
+ t.flags & TypeFlags.ESSymbol && includes & TypeFlags.UniqueESSymbol;
+ if (remove) {
+ orderedRemoveItemAt(types, i);
+ }
+ }
+ }
+
// We normalize combinations of intersection and union types based on the distributive property of the '&'
// operator. Specifically, because X & (A | B) is equivalent to X & A | X & B, we can transform intersection
// types with union type constituents into equivalent union types with intersection type constituents and
@@ -8153,19 +8314,24 @@ namespace ts {
}
const typeSet: Type[] = [];
const includes = addTypesToIntersection(typeSet, 0, types);
- if (includes & TypeIncludes.Never) {
+ if (includes & TypeFlags.Never) {
return neverType;
}
- if (includes & TypeIncludes.Any) {
- return includes & TypeIncludes.Wildcard ? wildcardType : anyType;
+ if (includes & TypeFlags.Any) {
+ return includes & TypeFlags.Wildcard ? wildcardType : anyType;
}
- if (includes & TypeIncludes.EmptyObject && !(includes & TypeIncludes.ObjectType)) {
+ if (includes & TypeFlags.String && includes & TypeFlags.StringLiteral ||
+ includes & TypeFlags.Number && includes & TypeFlags.NumberLiteral ||
+ includes & TypeFlags.ESSymbol && includes & TypeFlags.UniqueESSymbol) {
+ removeRedundantPrimitiveTypes(typeSet, includes);
+ }
+ if (includes & TypeFlags.EmptyObject && !(includes & TypeFlags.Object)) {
typeSet.push(emptyObjectType);
}
if (typeSet.length === 1) {
return typeSet[0];
}
- if (includes & TypeIncludes.Union) {
+ if (includes & TypeFlags.Union) {
// We are attempting to construct a type of the form X & (A | B) & Y. Transform this into a type of
// the form X & A & Y | X & B & Y and recursively reduce until no union type constituents remain.
const unionIndex = findIndex(typeSet, t => (t.flags & TypeFlags.Union) !== 0);
@@ -8195,53 +8361,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;
}
@@ -8299,7 +8479,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;
@@ -8330,9 +8514,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 {
@@ -8359,8 +8542,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)) {
@@ -8380,7 +8567,7 @@ namespace ts {
}
}
return getUnionType([
- getIndexedAccessType(getIntersectionType(regularTypes), type.indexType),
+ getSimplifiedType(getIndexedAccessType(getIntersectionType(regularTypes), type.indexType)),
getIntersectionType(stringIndexTypes)
]);
}
@@ -8390,13 +8577,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);
}
@@ -8406,7 +8593,7 @@ namespace ts {
return substituteIndexedMappedType(constraint, type);
}
}
- return undefined;
+ return type;
}
function substituteIndexedMappedType(objectType: MappedType, type: IndexedAccessType) {
@@ -8739,7 +8926,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;
}
@@ -8785,6 +8972,7 @@ namespace ts {
result.leftSpread = leftProp;
result.rightSpread = rightProp;
result.declarations = declarations;
+ result.nameType = leftProp.nameType;
members.set(leftProp.escapedName, result);
}
}
@@ -8813,6 +9001,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;
}
@@ -9158,8 +9347,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;
}
@@ -9175,10 +9369,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();
@@ -9960,6 +10159,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;
@@ -10053,6 +10258,23 @@ namespace ts {
}
}
}
+ if (!result && source.flags & TypeFlags.Intersection) {
+ // The combined constraint of an intersection type is the intersection of the constraints of
+ // the constituents. When an intersection type contains instantiable types with union type
+ // constraints, there are situations where we need to examine the combined constraint. One is
+ // when the target is a union type. Another is when the intersection contains types belonging
+ // to one of the disjoint domains. For example, given type variables T and U, each with the
+ // constraint 'string | number', the combined constraint of 'T & U' is 'string | number' and
+ // we need to check this constraint against a union on the target side. Also, given a type
+ // variable V constrained to 'string | number', 'V & number' has a combined constraint of
+ // 'string & number | number & number' which reduces to just 'number'.
+ const constraint = getUnionConstraintOfIntersection(source, !!(target.flags & TypeFlags.Union));
+ if (constraint) {
+ if (result = isRelatedTo(constraint, target, reportErrors)) {
+ errorInfo = saveErrorInfo;
+ }
+ }
+ }
isIntersectionConstituent = saveIsIntersectionConstituent;
@@ -10410,18 +10632,21 @@ namespace ts {
}
}
// A type S is assignable to keyof T if S is assignable to keyof C, where C is the
- // constraint of T.
- const constraint = getConstraintForRelation((target).type);
- if (constraint) {
- if (result = isRelatedTo(source, getIndexType(constraint, (target as IndexType).isDeclaredType), reportErrors)) {
- return result;
+ // simplified form of T or, if T doesn't simplify, the constraint of T.
+ if (relation !== definitelyAssignableRelation) {
+ const simplified = getSimplifiedType((target).type);
+ const constraint = simplified !== (target).type ? simplified : getConstraintOfType((target).type);
+ if (constraint) {
+ 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;
@@ -10434,25 +10659,35 @@ 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;
+ 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;
+ }
+ }
}
- // 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)) {
+ }
+
+ if (source.flags & TypeFlags.TypeVariable) {
+ if (source.flags & TypeFlags.IndexedAccess && 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);
+ }
+ if (result) {
errorInfo = saveErrorInfo;
return result;
}
}
- }
- }
-
- if (source.flags & TypeFlags.TypeParameter) {
let constraint = getConstraintForRelation(source);
- // A type parameter with no constraint is not related to the non-primitive object type.
+ // A type variable with no constraint is not related to the non-primitive object type.
if (constraint || !(target.flags & TypeFlags.NonPrimitive)) {
if (!constraint || constraint.flags & TypeFlags.Any) {
constraint = emptyObjectType;
@@ -10465,24 +10700,10 @@ 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 (result = isRelatedTo((source).objectType, (target).objectType, reportErrors)) {
- result &= isRelatedTo((source).indexType, (target).indexType, reportErrors);
- }
- if (result) {
- 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) {
@@ -10651,13 +10872,14 @@ namespace ts {
const sourcePropFlags = getDeclarationModifierFlagsFromSymbol(sourceProp);
const targetPropFlags = getDeclarationModifierFlagsFromSymbol(targetProp);
if (sourcePropFlags & ModifierFlags.Private || targetPropFlags & ModifierFlags.Private) {
- if (getCheckFlags(sourceProp) & CheckFlags.ContainsPrivate) {
+ const hasDifferingDeclarations = sourceProp.valueDeclaration !== targetProp.valueDeclaration;
+ if (getCheckFlags(sourceProp) & CheckFlags.ContainsPrivate && hasDifferingDeclarations) {
if (reportErrors) {
reportError(Diagnostics.Property_0_has_conflicting_declarations_and_is_inaccessible_in_type_1, symbolToString(sourceProp), typeToString(source));
}
return Ternary.False;
}
- if (sourceProp.valueDeclaration !== targetProp.valueDeclaration) {
+ if (hasDifferingDeclarations) {
if (reportErrors) {
if (sourcePropFlags & ModifierFlags.Private && targetPropFlags & ModifierFlags.Private) {
reportError(Diagnostics.Types_have_separate_declarations_of_a_private_property_0, symbolToString(targetProp));
@@ -10876,8 +11098,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)) {
@@ -11341,6 +11562,10 @@ namespace ts {
return !!getPropertyOfType(type, "0" as __String);
}
+ function isNeitherUnitTypeNorNever(type: Type): boolean {
+ return !(type.flags & (TypeFlags.Unit | TypeFlags.Never));
+ }
+
function isUnitType(type: Type): boolean {
return !!(type.flags & TypeFlags.Unit);
}
@@ -11480,6 +11705,9 @@ namespace ts {
if (source.valueDeclaration) {
symbol.valueDeclaration = source.valueDeclaration;
}
+ if (source.nameType) {
+ symbol.nameType = source.nameType;
+ }
return symbol;
}
@@ -11522,7 +11750,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[] {
@@ -11543,19 +11771,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 {
@@ -11565,18 +11793,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;
}
@@ -11588,9 +11812,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));
}
}
}
@@ -12347,14 +12571,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;
}
}
}
@@ -12822,8 +13045,7 @@ namespace ts {
function getTypeOfSwitchClause(clause: CaseClause | DefaultClause) {
if (clause.kind === SyntaxKind.CaseClause) {
- const caseType = getRegularTypeOfLiteralType(getTypeOfExpression(clause.expression));
- return isUnitType(caseType) ? caseType : undefined;
+ return getRegularTypeOfLiteralType(getTypeOfExpression(clause.expression));
}
return neverType;
}
@@ -12831,15 +13053,9 @@ namespace ts {
function getSwitchClauseTypes(switchStatement: SwitchStatement): Type[] {
const links = getNodeLinks(switchStatement);
if (!links.switchTypes) {
- // If all case clauses specify expressions that have unit types, we return an array
- // of those unit types. Otherwise we return an empty array.
links.switchTypes = [];
for (const clause of switchStatement.caseBlock.clauses) {
- const type = getTypeOfSwitchClause(clause);
- if (type === undefined) {
- return links.switchTypes = emptyArray;
- }
- links.switchTypes.push(type);
+ links.switchTypes.push(getTypeOfSwitchClause(clause));
}
}
return links.switchTypes;
@@ -15298,7 +15514,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 +15555,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 +15571,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 +15605,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 +15660,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 +17954,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 +18071,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 +18738,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 +18865,7 @@ namespace ts {
}
function checkTaggedTemplateExpression(node: TaggedTemplateExpression): Type {
+ checkGrammarTypeArguments(node, node.typeArguments);
if (languageVersion < ScriptTarget.ES2015) {
checkExternalEmitHelpers(node, ExternalEmitHelpers.MakeTemplateObject);
}
@@ -18696,6 +18897,17 @@ namespace ts {
function checkMetaProperty(node: MetaProperty) {
checkGrammarMetaProperty(node);
+
+ if (node.keywordToken === SyntaxKind.NewKeyword) {
+ return checkNewTargetMetaProperty(node);
+ }
+
+ if (node.keywordToken === SyntaxKind.ImportKeyword) {
+ return checkImportMetaProperty(node);
+ }
+ }
+
+ function checkNewTargetMetaProperty(node: MetaProperty) {
const container = getNewTargetContainer(node);
if (!container) {
error(node, Diagnostics.Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constructor, "new.target");
@@ -18711,6 +18923,16 @@ namespace ts {
}
}
+ function checkImportMetaProperty(node: MetaProperty) {
+ if (languageVersion < ScriptTarget.ESNext || moduleKind < ModuleKind.ESNext) {
+ error(node, Diagnostics.The_import_meta_meta_property_is_only_allowed_using_ESNext_for_the_target_and_module_compiler_options);
+ }
+ const file = getSourceFileOfNode(node);
+ Debug.assert(!!(file.flags & NodeFlags.PossiblyContainsImportMeta), "Containing file is missing import meta node flag.");
+ Debug.assert(!!file.externalModuleIndicator, "Containing file should be a module.");
+ return node.name.escapedText === "meta" ? getGlobalImportMetaType() : unknownType;
+ }
+
function getTypeOfParameter(symbol: Symbol) {
const type = getTypeOfSymbol(symbol);
if (strictNullChecks) {
@@ -18958,7 +19180,7 @@ namespace ts {
return false;
}
const switchTypes = getSwitchClauseTypes(node);
- if (!switchTypes.length) {
+ if (!switchTypes.length || some(switchTypes, isNeitherUnitTypeNorNever)) {
return false;
}
return eachTypeContainedIn(mapType(type, getRegularTypeOfLiteralType), switchTypes);
@@ -20031,6 +20253,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) {
@@ -20042,7 +20273,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) ||
@@ -20971,7 +21203,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));
@@ -21003,7 +21235,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) {
@@ -21870,6 +22102,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) {
@@ -22107,7 +22344,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));
}
}
@@ -22160,8 +22398,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)));
}
@@ -22316,7 +22555,7 @@ namespace ts {
function checkCollisionWithRequireExportsInGeneratedCode(node: Node, name: Identifier) {
// No need to check for require or exports for ES6 modules and later
- if (modulekind >= ModuleKind.ES2015 || compilerOptions.noEmit) {
+ if (moduleKind >= ModuleKind.ES2015 || compilerOptions.noEmit) {
return;
}
@@ -23535,20 +23774,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.
@@ -23609,7 +23849,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);
@@ -24069,6 +24309,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;
@@ -24470,7 +24713,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);
+ }
}
}
}
@@ -24505,7 +24751,7 @@ namespace ts {
}
}
else {
- if (modulekind >= ModuleKind.ES2015 && !(node.flags & NodeFlags.Ambient)) {
+ if (moduleKind >= ModuleKind.ES2015 && !(node.flags & NodeFlags.Ambient)) {
// Import equals declaration is deprecated in es6 or above
grammarErrorOnNode(node, Diagnostics.Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_import_d_from_mod_or_another_module_format_instead);
}
@@ -24543,7 +24789,7 @@ namespace ts {
error(node.moduleSpecifier, Diagnostics.Module_0_uses_export_and_cannot_be_used_with_export_Asterisk, symbolToString(moduleSymbol));
}
- if (modulekind !== ModuleKind.System && modulekind !== ModuleKind.ES2015 && modulekind !== ModuleKind.ESNext) {
+ if (moduleKind !== ModuleKind.System && moduleKind !== ModuleKind.ES2015 && moduleKind !== ModuleKind.ESNext) {
checkExternalEmitHelpers(node, ExternalEmitHelpers.ExportStar);
}
}
@@ -24616,11 +24862,11 @@ namespace ts {
}
if (node.isExportEquals && !(node.flags & NodeFlags.Ambient)) {
- if (modulekind >= ModuleKind.ES2015) {
+ if (moduleKind >= ModuleKind.ES2015) {
// export assignment is not supported in es6 modules
grammarErrorOnNode(node, Diagnostics.Export_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_export_default_or_another_module_format_instead);
}
- else if (modulekind === ModuleKind.System) {
+ else if (moduleKind === ModuleKind.System) {
// system modules does not support export assignment
grammarErrorOnNode(node, Diagnostics.Export_assignment_is_not_supported_when_module_flag_is_system);
}
@@ -24767,6 +25013,7 @@ namespace ts {
case SyntaxKind.JSDocNullableType:
case SyntaxKind.JSDocAllType:
case SyntaxKind.JSDocUnknownType:
+ case SyntaxKind.JSDocTypeLiteral:
checkJSDocTypeIsInJsFile(node);
forEachChild(node, checkSourceElement);
return;
@@ -26841,7 +27088,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 {
@@ -27567,10 +27814,18 @@ namespace ts {
}
function checkGrammarMetaProperty(node: MetaProperty) {
- if (node.keywordToken === SyntaxKind.NewKeyword) {
- if (node.name.escapedText !== "target") {
- return grammarErrorOnNode(node.name, Diagnostics._0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2, node.name.escapedText, tokenToString(node.keywordToken), "target");
- }
+ const escapedText = node.name.escapedText;
+ switch (node.keywordToken) {
+ case SyntaxKind.NewKeyword:
+ if (escapedText !== "target") {
+ return grammarErrorOnNode(node.name, Diagnostics._0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2, node.name.escapedText, tokenToString(node.keywordToken), "target");
+ }
+ break;
+ case SyntaxKind.ImportKeyword:
+ if (escapedText !== "meta") {
+ return grammarErrorOnNode(node.name, Diagnostics._0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2, node.name.escapedText, tokenToString(node.keywordToken), "meta");
+ }
+ break;
}
}
@@ -27769,7 +28024,7 @@ namespace ts {
}
function checkGrammarImportCallExpression(node: ImportCall): boolean {
- if (modulekind === ModuleKind.ES2015) {
+ if (moduleKind === ModuleKind.ES2015) {
return grammarErrorOnNode(node, Diagnostics.Dynamic_import_cannot_be_used_when_targeting_ECMAScript_2015_modules);
}
diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts
index f6550e3e0ed..d8ef19dc215 100644
--- a/src/compiler/commandLineParser.ts
+++ b/src/compiler/commandLineParser.ts
@@ -678,6 +678,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",
@@ -2127,19 +2133,10 @@ namespace ts {
});
function createDiagnostic(message: DiagnosticMessage, spec: string): Diagnostic {
- const jsonObjectLiteral = getTsConfigObjectLiteralExpression(jsonSourceFile);
- if (jsonObjectLiteral) {
- for (const property of getPropertyAssignment(jsonObjectLiteral, specKey)) {
- if (isArrayLiteralExpression(property.initializer)) {
- for (const element of property.initializer.elements) {
- if (isStringLiteral(element) && element.text === spec) {
- return createDiagnosticForNodeInSourceFile(jsonSourceFile, element, message, spec);
- }
- }
- }
- }
- }
- return createCompilerDiagnostic(message, spec);
+ const element = getTsConfigPropArrayElementValue(jsonSourceFile, specKey, spec);
+ return element ?
+ createDiagnosticForNodeInSourceFile(jsonSourceFile, element, message, spec) :
+ createCompilerDiagnostic(message, spec);
}
}
diff --git a/src/compiler/core.ts b/src/compiler/core.ts
index 5840a6bcef5..aba133a4795 100644
--- a/src/compiler/core.ts
+++ b/src/compiler/core.ts
@@ -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;
diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json
index 034da2d078d..865779b5151 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
@@ -967,6 +971,10 @@
"category": "Error",
"code": 1342
},
+ "The 'import.meta' meta-property is only allowed using 'ESNext' for the 'target' and 'module' compiler options.": {
+ "category": "Error",
+ "code": 1343
+ },
"Duplicate identifier '{0}'.": {
"category": "Error",
@@ -2947,10 +2955,6 @@
"category": "Message",
"code": 6040
},
- "Compilation complete. Watching for file changes.": {
- "category": "Message",
- "code": 6042
- },
"Generates corresponding '.map' file.": {
"category": "Message",
"code": 6043
@@ -3526,18 +3530,27 @@
"code": 6192,
"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 module name imported with '.json' extension to the json source file.": {
+ "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
+ },
+ "Resolve module name imported with '.json' extension to the json source file.": {
+ "category": "Message",
+ "code": 6197
+ },
"Variable '{0}' implicitly has an '{1}' type.": {
"category": "Error",
@@ -3927,7 +3940,7 @@
"category": "Message",
"code": 90007
},
- "Add 'this.' to unresolved variable": {
+ "Add '{0}.' to unresolved variable": {
"category": "Message",
"code": 90008
},
@@ -4135,7 +4148,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
},
diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts
index 0dbda93b362..2fe74d1dcb9 100644
--- a/src/compiler/emitter.ts
+++ b/src/compiler/emitter.ts
@@ -1445,9 +1445,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) {
@@ -1466,6 +1466,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 d6ab7d4e89c..c1678716d1a 100644
--- a/src/compiler/factory.ts
+++ b/src/compiler/factory.ts
@@ -1030,17 +1030,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 5ea149b93f6..94866a4c0f8 100644
--- a/src/compiler/moduleNameResolver.ts
+++ b/src/compiler/moduleNameResolver.ts
@@ -445,6 +445,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 252ae045da3..ed9f5307207 100644
--- a/src/compiler/parser.ts
+++ b/src/compiler/parser.ts
@@ -223,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) ||
@@ -539,7 +540,7 @@ namespace ts {
const newSourceFile = IncrementalParser.updateSourceFile(sourceFile, newText, textChangeRange, aggressiveChecks);
// Because new source file node is created, it may not have the flag PossiblyContainDynamicImport. This is the case if there is no new edit to add dynamic import.
// We will manually port the flag to the new source file.
- newSourceFile.flags |= (sourceFile.flags & NodeFlags.PossiblyContainsDynamicImport);
+ newSourceFile.flags |= (sourceFile.flags & NodeFlags.PermanentlySetIncrementalFlags);
return newSourceFile;
}
@@ -1280,7 +1281,7 @@ namespace ts {
if (reportAtCurrentPosition) {
parseErrorAtPosition(scanner.getStartPos(), 0, diagnosticMessage, arg0);
}
- else {
+ else if (diagnosticMessage) {
parseErrorAtCurrentToken(diagnosticMessage, arg0);
}
@@ -2665,6 +2666,20 @@ namespace ts {
return token() === SyntaxKind.OpenParenToken || token() === SyntaxKind.LessThanToken;
}
+ function nextTokenIsDot() {
+ return nextToken() === SyntaxKind.DotToken;
+ }
+
+ function nextTokenIsOpenParenOrLessThanOrDot() {
+ switch (nextToken()) {
+ case SyntaxKind.OpenParenToken:
+ case SyntaxKind.LessThanToken:
+ case SyntaxKind.DotToken:
+ return true;
+ }
+ return false;
+ }
+
function parseTypeLiteral(): TypeLiteralNode {
const node = createNode(SyntaxKind.TypeLiteral);
node.members = parseObjectTypeMembers();
@@ -3133,7 +3148,7 @@ namespace ts {
case SyntaxKind.Identifier:
return true;
case SyntaxKind.ImportKeyword:
- return lookAhead(nextTokenIsOpenParenOrLessThan);
+ return lookAhead(nextTokenIsOpenParenOrLessThanOrDot);
default:
return isIdentifier();
}
@@ -3995,14 +4010,31 @@ namespace ts {
// 3)we have a MemberExpression which either completes the LeftHandSideExpression,
// or starts the beginning of the first four CallExpression productions.
let expression: MemberExpression;
- if (token() === SyntaxKind.ImportKeyword && lookAhead(nextTokenIsOpenParenOrLessThan)) {
- // We don't want to eagerly consume all import keyword as import call expression so we look a head to find "("
- // For example:
- // var foo3 = require("subfolder
- // import * as foo1 from "module-from-node
- // We want this import to be a statement rather than import call expression
- sourceFile.flags |= NodeFlags.PossiblyContainsDynamicImport;
- expression = parseTokenNode();
+ if (token() === SyntaxKind.ImportKeyword) {
+ if (lookAhead(nextTokenIsOpenParenOrLessThan)) {
+ // We don't want to eagerly consume all import keyword as import call expression so we look ahead to find "("
+ // For example:
+ // var foo3 = require("subfolder
+ // import * as foo1 from "module-from-node
+ // We want this import to be a statement rather than import call expression
+ sourceFile.flags |= NodeFlags.PossiblyContainsDynamicImport;
+ expression = parseTokenNode();
+ }
+ else if (lookAhead(nextTokenIsDot)) {
+ // This is an 'import.*' metaproperty (i.e. 'import.meta')
+ const fullStart = scanner.getStartPos();
+ nextToken(); // advance past the 'import'
+ nextToken(); // advance past the dot
+ const node = createNode(SyntaxKind.MetaProperty, fullStart) as MetaProperty;
+ node.keywordToken = SyntaxKind.ImportKeyword;
+ node.name = parseIdentifierName();
+ expression = finishNode(node);
+
+ sourceFile.flags |= NodeFlags.PossiblyContainsImportMeta;
+ }
+ else {
+ expression = parseMemberExpressionOrHigher();
+ }
}
else {
expression = token() === SyntaxKind.SuperKeyword ? parseSuperExpression() : parseMemberExpressionOrHigher();
@@ -4388,14 +4420,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);
@@ -4403,13 +4436,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;
}
@@ -4417,6 +4445,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);
@@ -4430,6 +4472,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;
@@ -4477,8 +4524,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)
@@ -4546,7 +4595,7 @@ namespace ts {
case SyntaxKind.FunctionKeyword:
return parseFunctionExpression();
case SyntaxKind.NewKeyword:
- return parseNewExpression();
+ return parseNewExpressionOrNewDotTarget();
case SyntaxKind.SlashToken:
case SyntaxKind.SlashEqualsToken:
if (reScanSlashToken() === SyntaxKind.RegularExpressionLiteral) {
@@ -4697,7 +4746,7 @@ namespace ts {
return isIdentifier() ? parseIdentifier() : undefined;
}
- function parseNewExpression(): NewExpression | MetaProperty {
+ function parseNewExpressionOrNewDotTarget(): NewExpression | MetaProperty {
const fullStart = scanner.getStartPos();
parseExpected(SyntaxKind.NewKeyword);
if (parseOptional(SyntaxKind.DotToken)) {
@@ -4707,9 +4756,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();
}
@@ -5131,7 +5194,7 @@ namespace ts {
return true;
case SyntaxKind.ImportKeyword:
- return isStartOfDeclaration() || lookAhead(nextTokenIsOpenParenOrLessThan);
+ return isStartOfDeclaration() || lookAhead(nextTokenIsOpenParenOrLessThanOrDot);
case SyntaxKind.ConstKeyword:
case SyntaxKind.ExportKeyword:
@@ -6117,14 +6180,35 @@ namespace ts {
}
function setExternalModuleIndicator(sourceFile: SourceFile) {
- sourceFile.externalModuleIndicator = forEach(sourceFile.statements, node =>
- hasModifier(node, ModifierFlags.Export)
- || node.kind === SyntaxKind.ImportEqualsDeclaration && (node).moduleReference.kind === SyntaxKind.ExternalModuleReference
- || node.kind === SyntaxKind.ImportDeclaration
- || node.kind === SyntaxKind.ExportAssignment
- || node.kind === SyntaxKind.ExportDeclaration
+ // Try to use the first top-level import/export when available, then
+ // fall back to looking for an 'import.meta' somewhere in the tree if necessary.
+ sourceFile.externalModuleIndicator =
+ forEach(sourceFile.statements, isAnExternalModuleIndicatorNode) ||
+ getImportMetaIfNecessary(sourceFile);
+ }
+
+ function isAnExternalModuleIndicatorNode(node: Node) {
+ return hasModifier(node, ModifierFlags.Export)
+ || node.kind === SyntaxKind.ImportEqualsDeclaration && (node).moduleReference.kind === SyntaxKind.ExternalModuleReference
+ || node.kind === SyntaxKind.ImportDeclaration
+ || node.kind === SyntaxKind.ExportAssignment
+ || node.kind === SyntaxKind.ExportDeclaration
? node
- : undefined);
+ : undefined;
+ }
+
+ function getImportMetaIfNecessary(sourceFile: SourceFile) {
+ return sourceFile.flags & NodeFlags.PossiblyContainsImportMeta ?
+ walkTreeForExternalModuleIndicators(sourceFile) :
+ undefined;
+ }
+
+ function walkTreeForExternalModuleIndicators(node: Node): Node {
+ return isImportMeta(node) ? node : forEachChild(node, walkTreeForExternalModuleIndicators);
+ }
+
+ function isImportMeta(node: Node): boolean {
+ return isMetaProperty(node) && node.keywordToken === SyntaxKind.ImportKeyword && node.name.escapedText === "meta";
}
const enum ParsingContext {
diff --git a/src/compiler/program.ts b/src/compiler/program.ts
index acb888d09cf..826933f2629 100644
--- a/src/compiler/program.ts
+++ b/src/compiler/program.ts
@@ -622,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) {
@@ -670,7 +667,8 @@ namespace ts {
sourceFileToPackageName,
redirectTargetsSet,
isEmittedFile,
- getConfigFileParsingDiagnostics
+ getConfigFileParsingDiagnostics,
+ getResolvedModuleWithFailedLookupLocationsFromCache,
};
verifyCompilerOptions();
@@ -679,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);
}
@@ -984,7 +986,7 @@ namespace ts {
// moduleAugmentations has changed
oldProgram.structureIsReused = StructureIsReused.SafeModules;
}
- if ((oldSourceFile.flags & NodeFlags.PossiblyContainsDynamicImport) !== (newSourceFile.flags & NodeFlags.PossiblyContainsDynamicImport)) {
+ if ((oldSourceFile.flags & NodeFlags.PermanentlySetIncrementalFlags) !== (newSourceFile.flags & NodeFlags.PermanentlySetIncrementalFlags)) {
// dynamicImport has changed
oldProgram.structureIsReused = StructureIsReused.SafeModules;
}
@@ -1624,6 +1626,9 @@ namespace ts {
collectDynamicImportOrRequireCalls(node);
}
}
+ if ((file.flags & NodeFlags.PossiblyContainsDynamicImport) || isJavaScriptFile) {
+ collectDynamicImportOrRequireCalls(file.endOfFileToken);
+ }
file.imports = imports || emptyArray;
file.moduleAugmentations = moduleAugmentations || emptyArray;
@@ -2004,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 c2b96649cf2..35e056546c0 100644
--- a/src/compiler/resolutionCache.ts
+++ b/src/compiler/resolutionCache.ts
@@ -10,6 +10,7 @@ namespace ts {
invalidateResolutionOfFile(filePath: Path): void;
removeResolutionsOfFile(filePath: Path): void;
+ setFilesWithInvalidatedNonRelativeUnresolvedImports(filesWithUnresolvedImports: Map>): void;
createHasInvalidatedResolution(forceAllFilesAsInvalidated?: boolean): HasInvalidatedResolution;
startCachingPerDirectoryResolution(): void;
@@ -74,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());
@@ -122,6 +124,7 @@ namespace ts {
resolveTypeReferenceDirectives,
removeResolutionsOfFile,
invalidateResolutionOfFile,
+ setFilesWithInvalidatedNonRelativeUnresolvedImports,
createHasInvalidatedResolution,
updateTypeRootsWatch,
closeTypeRootsWatch,
@@ -165,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
@@ -173,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() {
@@ -184,6 +198,7 @@ namespace ts {
function finishCachingPerDirectoryResolution() {
allFilesHaveInvalidatedResolution = false;
+ filesWithInvalidatedNonRelativeUnresolvedImports = undefined;
directoryWatchesOfFailedLookups.forEach((watcher, path) => {
if (watcher.refCount === 0) {
directoryWatchesOfFailedLookups.delete(path);
@@ -237,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) {
@@ -284,7 +301,7 @@ namespace ts {
if (oldResolution === newResolution) {
return true;
}
- if (!oldResolution || !newResolution || oldResolution.isInvalidated) {
+ if (!oldResolution || !newResolution) {
return false;
}
const oldResult = getResolutionWithResolvedFileName(oldResolution);
@@ -577,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/sys.ts b/src/compiler/sys.ts
index c37315a2e56..be95e06eb46 100644
--- a/src/compiler/sys.ts
+++ b/src/compiler/sys.ts
@@ -428,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;
@@ -561,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/transformers/destructuring.ts b/src/compiler/transformers/destructuring.ts
index 35101d3be7f..2dd8946e8e2 100644
--- a/src/compiler/transformers/destructuring.ts
+++ b/src/compiler/transformers/destructuring.ts
@@ -46,7 +46,7 @@ namespace ts {
value = node.right;
}
else {
- return value;
+ return visitNode(value, visitor, isExpression);
}
}
}
diff --git a/src/compiler/transformers/ts.ts b/src/compiler/transformers/ts.ts
index 6cb4be16c74..f29829d4607 100644
--- a/src/compiler/transformers/ts.ts
+++ b/src/compiler/transformers/ts.ts
@@ -502,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);
@@ -2547,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 f16ca98c93d..e45a95f7989 100644
--- a/src/compiler/tsc.ts
+++ b/src/compiler/tsc.ts
@@ -19,11 +19,18 @@ namespace ts {
let reportDiagnostic = createDiagnosticReporter(sys);
function updateReportDiagnostic(options: CompilerOptions) {
- if (options.pretty) {
+ 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;
@@ -147,9 +154,12 @@ namespace ts {
function updateWatchCompilationHost(watchCompilerHost: WatchCompilerHost) {
const compileUsingBuilder = watchCompilerHost.createProgram;
- watchCompilerHost.createProgram = (rootNames, options, host, oldProgram) => {
- enableStatistics(options);
- return compileUsingBuilder(rootNames, options, host, oldProgram);
+ watchCompilerHost.createProgram = (rootNames, options, host, oldProgram, configFileParsingDiagnostics) => {
+ Debug.assert(rootNames !== undefined || (options === undefined && !!oldProgram));
+ if (options !== undefined) {
+ enableStatistics(options);
+ }
+ return compileUsingBuilder(rootNames, options, host, oldProgram, configFileParsingDiagnostics);
};
const emitFilesUsingBuilder = watchCompilerHost.afterProgramCreate;
watchCompilerHost.afterProgramCreate = builderProgram => {
@@ -159,7 +169,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/types.ts b/src/compiler/types.ts
index 269aa89e602..71a706e8e44 100644
--- a/src/compiler/types.ts
+++ b/src/compiler/types.ts
@@ -490,20 +490,22 @@ namespace ts {
ThisNodeOrAnySubNodesHasError = 1 << 17, // If this node or any of its children had an error
HasAggregatedChildData = 1 << 18, // If we've computed data from children and cached it in this node
- // This flag will be set when the parser encounters a dynamic import expression so that module resolution
- // will not have to walk the tree if the flag is not set. However, this flag is just a approximation because
- // once it is set, the flag never gets cleared (hence why it's named "PossiblyContainsDynamicImport").
- // During editing, if dynamic import is removed, incremental parsing will *NOT* update this flag. This means that the tree will always be traversed
- // during module resolution. However, the removal operation should not occur often and in the case of the
+ // These flags will be set when the parser encounters a dynamic import expression or 'import.meta' to avoid
+ // walking the tree if the flags are not set. However, these flags are just a approximation
+ // (hence why it's named "PossiblyContainsDynamicImport") because once set, the flags never get cleared.
+ // During editing, if a dynamic import is removed, incremental parsing will *NOT* clear this flag.
+ // This means that the tree will always be traversed during module resolution, or when looking for external module indicators.
+ // However, the removal operation should not occur often and in the case of the
// removal, it is likely that users will add the import anyway.
// The advantage of this approach is its simplicity. For the case of batch compilation,
// we guarantee that users won't have to pay the price of walking the tree if a dynamic import isn't used.
- /* @internal */
- PossiblyContainsDynamicImport = 1 << 19,
- JSDoc = 1 << 20, // If node was parsed inside jsdoc
- /* @internal */ Ambient = 1 << 21, // If node was inside an ambient context -- a declaration file, or inside something with the `declare` modifier.
- /* @internal */ InWithStatement = 1 << 22, // If any ancestor of node was the `statement` of a WithStatement (not the `expression`)
- JsonFile = 1 << 23, // If node was parsed in a Json
+ /* @internal */ PossiblyContainsDynamicImport = 1 << 19,
+ /* @internal */ PossiblyContainsImportMeta = 1 << 20,
+
+ JSDoc = 1 << 21, // If node was parsed inside jsdoc
+ /* @internal */ Ambient = 1 << 22, // If node was inside an ambient context -- a declaration file, or inside something with the `declare` modifier.
+ /* @internal */ InWithStatement = 1 << 23, // If any ancestor of node was the `statement` of a WithStatement (not the `expression`)
+ JsonFile = 1 << 24, // If node was parsed in a Json
BlockScoped = Let | Const,
@@ -515,6 +517,11 @@ namespace ts {
// Exclude these flags when parsing a Type
TypeExcludesFlags = YieldContext | AwaitContext,
+
+ // Represents all flags that are potentially set once and
+ // never cleared on SourceFiles which get re-used in between incremental parses.
+ // See the comment above on `PossiblyContainsDynamicImport` and `PossiblyContainsImportMeta`.
+ /* @internal */ PermanentlySetIncrementalFlags = PossiblyContainsDynamicImport | PossiblyContainsImportMeta,
}
export const enum ModifierFlags {
@@ -880,6 +887,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;
@@ -1685,7 +1693,7 @@ namespace ts {
export interface ElementAccessExpression extends MemberExpression {
kind: SyntaxKind.ElementAccessExpression;
expression: LeftHandSideExpression;
- argumentExpression?: Expression;
+ argumentExpression: Expression;
}
export interface SuperElementAccessExpression extends ElementAccessExpression {
@@ -1727,6 +1735,7 @@ namespace ts {
export interface TaggedTemplateExpression extends MemberExpression {
kind: SyntaxKind.TaggedTemplateExpression;
tag: LeftHandSideExpression;
+ typeArguments?: NodeArray;
template: TemplateLiteral;
}
@@ -1755,7 +1764,7 @@ namespace ts {
// for the same reasons we treat NewExpression as a PrimaryExpression.
export interface MetaProperty extends PrimaryExpression {
kind: SyntaxKind.MetaProperty;
- keywordToken: SyntaxKind.NewKeyword;
+ keywordToken: SyntaxKind.NewKeyword | SyntaxKind.ImportKeyword;
name: Identifier;
}
@@ -1892,7 +1901,7 @@ namespace ts {
kind: SyntaxKind.DebuggerStatement;
}
- export interface MissingDeclaration extends DeclarationStatement, ClassElement, ObjectLiteralElement, TypeElement {
+ export interface MissingDeclaration extends DeclarationStatement {
kind: SyntaxKind.MissingDeclaration;
name?: Identifier;
}
@@ -2331,7 +2340,7 @@ namespace ts {
}
export interface JSDocTag extends Node {
- parent: JSDoc;
+ parent: JSDoc | JSDocTypeLiteral;
atToken: AtToken;
tagName: Identifier;
comment: string | undefined;
@@ -2556,7 +2565,11 @@ namespace ts {
languageVersion: ScriptTarget;
/* @internal */ scriptKind: ScriptKind;
- // The first node that causes this file to be an external module
+ /**
+ * The first "most obvious" node that makes a file an external module.
+ * This is intended to be the first top-level import/export,
+ * but could be arbitrarily nested (e.g. `import.meta`).
+ */
/* @internal */ externalModuleIndicator: Node;
// The first node that causes this file to be a CommonJS module
/* @internal */ commonJsModuleIndicator: Node;
@@ -2737,6 +2750,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 */
@@ -3010,6 +3025,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 */
@@ -3206,7 +3228,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] };
@@ -3386,6 +3409,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?
@@ -3420,7 +3444,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 */
@@ -3617,11 +3640,14 @@ 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,
ESSymbolLike = ESSymbol | UniqueESSymbol,
+ VoidLike = Void | Undefined,
+ /* @internal */
+ DisjointDomains = NonPrimitive | StringLike | NumberLike | BooleanLike | ESSymbolLike | VoidLike | Null,
UnionOrIntersection = Union | Intersection,
StructuredType = Object | Union | Intersection,
TypeVariable = TypeParameter | IndexedAccess,
@@ -3638,7 +3664,15 @@ namespace ts {
RequiresWidening = ContainsWideningType | ContainsObjectLiteral,
/* @internal */
PropagatingFlags = ContainsWideningType | ContainsObjectLiteral | ContainsAnyFunctionType,
+ // The following flags are used for different purposes during union and intersection type construction
/* @internal */
+ NonWideningType = ContainsWideningType,
+ /* @internal */
+ Wildcard = ContainsObjectLiteral,
+ /* @internal */
+ EmptyObject = ContainsAnyFunctionType,
+ /* @internal */
+ ConstructionFlags = NonWideningType | Wildcard | EmptyObject
}
export type DestructuringPattern = BindingPattern | ObjectLiteralExpression | ArrayLiteralExpression;
@@ -3774,7 +3808,7 @@ namespace ts {
/* @internal */
resolvedIndexType: IndexType;
/* @internal */
- resolvedDeclaredIndexType: IndexType;
+ resolvedStringIndexType: IndexType;
/* @internal */
resolvedBaseConstraint: Type;
/* @internal */
@@ -3863,7 +3897,7 @@ namespace ts {
/* @internal */
resolvedIndexType?: IndexType;
/* @internal */
- resolvedDeclaredIndexType?: IndexType;
+ resolvedStringIndexType?: IndexType;
}
// Type parameters (TypeFlags.TypeParameter)
@@ -3895,9 +3929,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 {
@@ -4056,10 +4090,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 */
@@ -4174,6 +4208,7 @@ namespace ts {
inlineSources?: boolean;
isolatedModules?: boolean;
jsx?: JsxEmit;
+ keyofStringsOnly?: boolean;
lib?: string[];
/*@internal*/listEmittedFiles?: boolean;
/*@internal*/listFiles?: boolean;
@@ -4207,7 +4242,7 @@ namespace ts {
preserveSymlinks?: boolean;
/* @internal */ preserveWatchOutput?: boolean;
project?: string;
- /* @internal */ pretty?: DiagnosticStyle;
+ /* @internal */ pretty?: boolean;
reactNamespace?: string;
jsxFactory?: string;
removeComments?: boolean;
@@ -4306,12 +4341,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 ccd0802601b..96cfa64de44 100644
--- a/src/compiler/utilities.ts
+++ b/src/compiler/utilities.ts
@@ -1081,6 +1081,21 @@ namespace ts {
}
}
+ export function getTsConfigPropArrayElementValue(tsConfigSourceFile: TsConfigSourceFile, propKey: string, elementValue: string): StringLiteral {
+ const jsonObjectLiteral = getTsConfigObjectLiteralExpression(tsConfigSourceFile);
+ if (jsonObjectLiteral) {
+ for (const property of getPropertyAssignment(jsonObjectLiteral, propKey)) {
+ if (isArrayLiteralExpression(property.initializer)) {
+ for (const element of property.initializer.elements) {
+ if (isStringLiteral(element) && element.text === elementValue) {
+ return element;
+ }
+ }
+ }
+ }
+ }
+ }
+
export function getContainingFunction(node: Node): SignatureDeclaration {
return findAncestor(node.parent, isFunctionLike);
}
@@ -1726,8 +1741,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));
}
}
@@ -1832,10 +1849,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.
@@ -1844,16 +1859,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);
}
@@ -1902,6 +1919,15 @@ namespace ts {
}
export function getJSDocHost(node: JSDocTag): HasJSDoc {
+ while (node.parent.kind === SyntaxKind.JSDocTypeLiteral) {
+ if (node.parent.parent.kind === SyntaxKind.JSDocTypedefTag) {
+ node = node.parent.parent as JSDocTypedefTag;
+ }
+ else {
+ // node.parent.parent is a type expression, child of a parameter type
+ node = node.parent.parent.parent as JSDocParameterTag;
+ }
+ }
Debug.assert(node.parent!.kind === SyntaxKind.JSDocComment);
return node.parent!.parent!;
}
@@ -2151,11 +2177,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) {
@@ -2947,11 +2975,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 {
@@ -3053,6 +3077,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.
@@ -3065,11 +3093,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;
}
@@ -4034,12 +4062,14 @@ namespace ts {
}
/** Add a value to a set, and return true if it wasn't already present. */
- export function addToSeen(seen: Map, key: string | number): boolean {
+ export function addToSeen(seen: Map, key: string | number): boolean;
+ export function addToSeen(seen: Map, key: string | number, value: T): boolean;
+ export function addToSeen(seen: Map, key: string | number, value: T = true as any): boolean {
key = String(key);
if (seen.has(key)) {
return false;
}
- seen.set(key, true);
+ seen.set(key, value);
return true;
}
@@ -4287,8 +4317,9 @@ namespace ts {
}
}
- export function isParameterPropertyDeclaration(node: Node): node is ParameterDeclaration {
- 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 {
@@ -4937,6 +4968,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 {
@@ -5617,8 +5652,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 {
@@ -5649,8 +5683,7 @@ 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 {
@@ -5664,8 +5697,7 @@ namespace ts {
|| kind === SyntaxKind.SpreadAssignment
|| kind === SyntaxKind.MethodDeclaration
|| kind === SyntaxKind.GetAccessor
- || kind === SyntaxKind.SetAccessor
- || kind === SyntaxKind.MissingDeclaration;
+ || kind === SyntaxKind.SetAccessor;
}
// Type
diff --git a/src/compiler/visitor.ts b/src/compiler/visitor.ts
index 7a70eb02e8e..284d870caa1 100644
--- a/src/compiler/visitor.ts
+++ b/src/compiler/visitor.ts
@@ -478,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 7f3d078b790..9ec362a12c0 100644
--- a/src/compiler/watch.ts
+++ b/src/compiler/watch.ts
@@ -29,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;
}
/**
@@ -52,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);
};
}
@@ -231,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);
}
};
@@ -602,9 +625,19 @@ namespace ts {
builderProgram = createProgram(/*rootNames*/ undefined, /*options*/ undefined, compilerHost, builderProgram, configFileParsingDiagnostics);
hasChangedConfigFileParsingErrors = false;
}
- return builderProgram;
+ }
+ else {
+ createNewProgram(program, hasInvalidatedResolution);
}
+ if (host.afterProgramCreate) {
+ host.afterProgramCreate(builderProgram);
+ }
+
+ return builderProgram;
+ }
+
+ function createNewProgram(program: Program, hasInvalidatedResolution: HasInvalidatedResolution) {
// Compile the program
if (watchLogLevel !== WatchLogLevel.None) {
writeLog("CreatingProgramWith::");
@@ -640,12 +673,6 @@ namespace ts {
}
missingFilePathsRequestedForRelease = undefined;
}
-
- if (host.afterProgramCreate) {
- host.afterProgramCreate(builderProgram);
- }
- reportWatchDiagnostic(Diagnostics.Compilation_complete_Watching_for_file_changes);
- return builderProgram;
}
function updateRootFileNames(files: string[]) {
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 b479b5596a8..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}'.`);
}
@@ -2103,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();
@@ -2425,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}`);
}
@@ -2910,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) {
@@ -2919,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) : [];
@@ -3219,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;
@@ -3281,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) {
@@ -3755,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 {
@@ -4362,6 +4369,10 @@ namespace FourSlashInterface {
public allRangesAppearInImplementationList(markerName: string) {
this.state.verifyRangesInImplementationList(markerName);
}
+
+ public getEditsForFileRename(options: GetEditsForFileRenameOptions) {
+ this.state.getEditsForFileRename(options);
+ }
}
export class Edit {
@@ -4645,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;
@@ -4702,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 f6d12f8f570..f75ca03a588 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 0d56447b28a..a4ad8cb3797 100644
--- a/src/harness/tsconfig.json
+++ b/src/harness/tsconfig.json
@@ -70,6 +70,7 @@
"../services/navigateTo.ts",
"../services/navigationBar.ts",
"../services/organizeImports.ts",
+ "../services/getEditsForFileRename.ts",
"../services/outliningElementsCollector.ts",
"../services/patternMatcher.ts",
"../services/preProcess.ts",
@@ -112,10 +113,8 @@
"../services/codefixes/fixInvalidImportSyntax.ts",
"../services/codefixes/fixStrictClassInitialization.ts",
"../services/codefixes/useDefaultImport.ts",
- "../services/codefixes/fixes.ts",
"../services/refactors/extractSymbol.ts",
"../services/refactors/generateGetAccessorAndSetAccessor.ts",
- "../services/refactors/refactors.ts",
"../services/sourcemaps.ts",
"../services/services.ts",
"../services/breakpoints.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/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..ca681a8f8ce 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[]) {
@@ -417,6 +418,28 @@ namespace ts.tscWatch {
checkProgramRootFiles(watch(), [commonFile1.path]);
});
+ it("works correctly when config file is changed but its content havent", () => {
+ const configFile: FileOrFolder = {
+ path: "/a/b/tsconfig.json",
+ content: `{
+ "compilerOptions": {},
+ "files": ["${commonFile1.path}", "${commonFile2.path}"]
+ }`
+ };
+ const files = [libFile, commonFile1, commonFile2, configFile];
+ const host = createWatchedSystem(files);
+ const watch = createWatchOfConfigFile(configFile.path, host);
+
+ checkProgramActualFiles(watch(), [libFile.path, commonFile1.path, commonFile2.path]);
+ checkOutputErrorsInitial(host, emptyArray);
+
+ host.modifyFile(configFile.path, configFile.content);
+ host.checkTimeoutQueueLengthAndRun(1); // reload the configured project
+
+ checkProgramActualFiles(watch(), [libFile.path, commonFile1.path, commonFile2.path]);
+ checkOutputErrorsIncremental(host, emptyArray);
+ });
+
it("files explicitly excluded in config file", () => {
const configFile: FileOrFolder = {
path: "/a/b/tsconfig.json",
diff --git a/src/harness/unittests/tsserverProjectSystem.ts b/src/harness/unittests/tsserverProjectSystem.ts
index b167ed21b94..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", () => {
@@ -4291,10 +4380,6 @@ namespace ts.projectSystem {
session.clearMessages();
});
-
- 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 };
- }
});
describe("tsserverProjectSystem Configure file diagnostics events", () => {
@@ -7294,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: {
@@ -7822,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 1a19c98f477..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)", () => {
@@ -1621,4 +1645,75 @@ namespace ts.projectSystem {
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..323a51c25ae 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();
@@ -385,21 +393,7 @@ interface Array {}`
if (isString(fileOrDirectory.content)) {
// Update file
if (currentEntry.content !== fileOrDirectory.content) {
- if (options && options.invokeFileDeleteCreateAsPartInsteadOfChange) {
- this.removeFileOrFolder(currentEntry, returnFalse);
- this.ensureFileOrFolder(fileOrDirectory);
- }
- else {
- currentEntry.content = fileOrDirectory.content;
- currentEntry.modifiedTime = this.now();
- this.fs.get(getDirectoryPath(currentEntry.path)).modifiedTime = this.now();
- if (options && options.invokeDirectoryWatcherInsteadOfFileChanged) {
- this.invokeDirectoryWatcher(getDirectoryPath(currentEntry.fullPath), currentEntry.fullPath);
- }
- else {
- this.invokeFileWatcher(currentEntry.fullPath, FileWatcherEventKind.Changed);
- }
- }
+ this.modifyFile(fileOrDirectory.path, fileOrDirectory.content, options);
}
}
else {
@@ -438,6 +432,30 @@ interface Array {}`
}
}
+ modifyFile(filePath: string, content: string, options?: Partial) {
+ const path = this.toFullPath(filePath);
+ const currentEntry = this.fs.get(path);
+ if (!currentEntry || !isFile(currentEntry)) {
+ throw new Error(`file not present: ${filePath}`);
+ }
+
+ if (options && options.invokeFileDeleteCreateAsPartInsteadOfChange) {
+ this.removeFileOrFolder(currentEntry, returnFalse);
+ this.ensureFileOrFolder({ path: filePath, content });
+ }
+ else {
+ currentEntry.content = content;
+ currentEntry.modifiedTime = this.now();
+ this.fs.get(getDirectoryPath(currentEntry.path)).modifiedTime = this.now();
+ if (options && options.invokeDirectoryWatcherInsteadOfFileChanged) {
+ this.invokeDirectoryWatcher(getDirectoryPath(currentEntry.fullPath), currentEntry.fullPath);
+ }
+ else {
+ this.invokeFileWatcher(currentEntry.fullPath, FileWatcherEventKind.Changed);
+ }
+ }
+ }
+
renameFolder(folderName: string, newFolderName: string) {
const fullPath = getNormalizedAbsolutePath(folderName, this.currentDirectory);
const path = this.toPath(fullPath);
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 ea59c10c83e..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.
@@ -505,6 +507,15 @@ interface TemplateStringsArray extends ReadonlyArray {
readonly raw: ReadonlyArray;
}
+/**
+ * The type of `import.meta`.
+ *
+ * If you need to declare that a given property exists on `import.meta`,
+ * this type may be augmented via interface merging.
+ */
+interface ImportMeta {
+}
+
interface Math {
/** The mathematical constant e. This is Euler's number, the base of natural logarithms. */
readonly E: number;
@@ -1340,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 c2b2cf32cde..1cfc21834fe 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 @@
- -
+
-
-
+
-
+
- -
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1254,6 +1251,15 @@
+ -
+
+
+
+
+
+
+
+
-
@@ -2388,15 +2394,6 @@
- -
-
-
-
-
-
-
-
-
-
@@ -3771,20 +3768,20 @@
- -
+
-
-
+
-
+
- -
+
-
-
+
-
+
@@ -6516,6 +6513,15 @@
+ -
+
+
+
+
+
+
+
+
-
@@ -8766,6 +8772,15 @@
+ -
+
+
+
+
+
+
+
+
-
diff --git a/src/loc/lcl/cht/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/cht/diagnosticMessages/diagnosticMessages.generated.json.lcl
index 1e9d7342817..f6f14d4a402 100644
--- a/src/loc/lcl/cht/diagnosticMessages/diagnosticMessages.generated.json.lcl
+++ b/src/loc/lcl/cht/diagnosticMessages/diagnosticMessages.generated.json.lcl
@@ -903,6 +903,15 @@
+ -
+
+
+
+
+
+
+
+
-
@@ -999,27 +1008,15 @@
- -
+
-
-
+
-
+
- -
-
-
-
-
-
-
-
-
-
-
-
-
@@ -2388,15 +2385,6 @@
- -
-
-
-
-
-
-
-
-
-
@@ -3771,20 +3759,20 @@
- -
+
-
-
+
-
+
- -
+
-
-
+
-
+
@@ -3900,6 +3888,9 @@
-
+
+
+
@@ -6015,6 +6006,9 @@
-
+
+
+
@@ -6510,6 +6504,12 @@
+ -
+
+
+
+
+
-
diff --git a/src/loc/lcl/csy/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/csy/diagnosticMessages/diagnosticMessages.generated.json.lcl
index db17f37967b..2690ba4fe89 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 @@
- -
+
-
-
+
-
+
- -
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1263,6 +1260,15 @@
+ -
+
+
+
+
+
+
+
+
-
@@ -2397,15 +2403,6 @@
- -
-
-
-
-
-
-
-
-
-
@@ -3780,20 +3777,20 @@
- -
+
-
-
+
-
+
- -
+
-
-
+
-
+
@@ -3906,6 +3903,15 @@
+ -
+
+
+
+
+
+
+
+
-
@@ -6018,6 +6024,9 @@
-
+
+
+
@@ -6513,6 +6522,15 @@
+ -
+
+
+
+
+
+
+
+
-
@@ -8763,6 +8781,15 @@
+ -
+
+
+
+
+
+
+
+
-
diff --git a/src/loc/lcl/deu/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/deu/diagnosticMessages/diagnosticMessages.generated.json.lcl
index 58326d7ccb6..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,20 +3756,20 @@
- -
+
-
-
+
-
+
- -
+
-
-
+
-
+
@@ -3894,6 +3882,15 @@
+ -
+
+
+
+
+
+
+
+
-
@@ -6003,6 +6000,9 @@
-
+
+
+
@@ -6498,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 342918edc19..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,20 +3768,20 @@
- -
+
-
-
+
-
+
- -
+
-
-
+
-
+
@@ -3906,6 +3894,15 @@
+ -
+
+
+
+
+
+
+
+
-
@@ -6018,6 +6015,9 @@
-
+
+
+
@@ -6513,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 52881bd0f4e..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 @@
- -
+
-
-
+
-
+
- -
-
-
-
-
-
-
-
-
-
-
-
-
@@ -2397,15 +2394,6 @@
- -
-
-
-
-
-
-
-
-
-
@@ -3780,20 +3768,20 @@
- -
+
-
-
+
-
+
- -
+
-
-
+
-
+
@@ -3906,6 +3894,15 @@
+ -
+
+
+
+
+
+
+
+
-
@@ -6018,6 +6015,9 @@
-
+
+
+
@@ -6513,6 +6513,12 @@
+ -
+
+
+
+
+
-
diff --git a/src/loc/lcl/ita/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/ita/diagnosticMessages/diagnosticMessages.generated.json.lcl
index f68671fdc91..fa924a9d856 100644
--- a/src/loc/lcl/ita/diagnosticMessages/diagnosticMessages.generated.json.lcl
+++ b/src/loc/lcl/ita/diagnosticMessages/diagnosticMessages.generated.json.lcl
@@ -903,6 +903,15 @@
+ -
+
+
+
+
+
+
+
+
-
@@ -999,27 +1008,15 @@
- -
+
-
-
+
-
+
- -
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1254,6 +1251,15 @@
+ -
+
+
+
+
+
+
+
+
-
@@ -2388,15 +2394,6 @@
- -
-
-
-
-
-
-
-
-
-
@@ -3771,20 +3768,20 @@
- -
+
-
-
+
-
+
- -
+
-
-
+
-
+
@@ -6516,6 +6513,15 @@
+ -
+
+
+
+
+
+
+
+
-
@@ -8766,6 +8772,15 @@
+ -
+
+
+
+
+
+
+
+
-
diff --git a/src/loc/lcl/jpn/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/jpn/diagnosticMessages/diagnosticMessages.generated.json.lcl
index a0f54926f3f..235f19b459f 100644
--- a/src/loc/lcl/jpn/diagnosticMessages/diagnosticMessages.generated.json.lcl
+++ b/src/loc/lcl/jpn/diagnosticMessages/diagnosticMessages.generated.json.lcl
@@ -903,6 +903,15 @@
+ -
+
+
+
+
+
+
+
+
-
@@ -999,27 +1008,15 @@
- -
+
-
-
+
-
+
- -
-
-
-
-
-
-
-
-
-
-
-
-
@@ -2388,15 +2385,6 @@
- -
-
-
-
-
-
-
-
-
-
@@ -3771,20 +3759,20 @@
- -
+
-
-
+
-
+
- -
+
-
-
+
-
+
@@ -3897,6 +3885,15 @@
+ -
+
+
+
+
+
+
+
+
-
@@ -6009,6 +6006,9 @@
-
+
+
+
@@ -6504,6 +6504,12 @@
+ -
+
+
+
+
+
-
diff --git a/src/loc/lcl/kor/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/kor/diagnosticMessages/diagnosticMessages.generated.json.lcl
index 4b42ff8b2bf..7c615261dea 100644
--- a/src/loc/lcl/kor/diagnosticMessages/diagnosticMessages.generated.json.lcl
+++ b/src/loc/lcl/kor/diagnosticMessages/diagnosticMessages.generated.json.lcl
@@ -903,6 +903,15 @@
+ -
+
+
+
+
+
+
+
+
-
@@ -999,27 +1008,15 @@
- -
+
-
-
+
-
+
- -
-
-
-
-
-
-
-
-
-
-
-
-
@@ -2388,15 +2385,6 @@
- -
-
-
-
-
-
-
-
-
-
@@ -3771,20 +3759,20 @@
- -
+
-
-
+
-
+
- -
+
-
-
+
-
+
@@ -3897,6 +3885,15 @@
+ -
+
+
+
+
+
+
+
+
-
@@ -6009,6 +6006,9 @@
-
+
+
+
@@ -6504,6 +6504,12 @@
+ -
+
+
+
+
+
-
diff --git a/src/loc/lcl/plk/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/plk/diagnosticMessages/diagnosticMessages.generated.json.lcl
index 36e67c41077..f7c9f90e59e 100644
--- a/src/loc/lcl/plk/diagnosticMessages/diagnosticMessages.generated.json.lcl
+++ b/src/loc/lcl/plk/diagnosticMessages/diagnosticMessages.generated.json.lcl
@@ -893,6 +893,15 @@
+ -
+
+
+
+
+
+
+
+
-
@@ -989,27 +998,15 @@
- -
+
-
-
+
-
+
- -
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1244,6 +1241,15 @@
+ -
+
+
+
+
+
+
+
+
-
@@ -2378,15 +2384,6 @@
- -
-
-
-
-
-
-
-
-
-
@@ -3761,20 +3758,20 @@
- -
+
-
-
+
-
+
- -
+
-
-
+
-
+
@@ -6503,6 +6500,15 @@
+ -
+
+
+
+
+
+
+
+
-
@@ -8753,6 +8759,15 @@
+ -
+
+
+
+
+
+
+
+
-
diff --git a/src/loc/lcl/ptb/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/ptb/diagnosticMessages/diagnosticMessages.generated.json.lcl
index 473da1a4a01..ce8b767afab 100644
--- a/src/loc/lcl/ptb/diagnosticMessages/diagnosticMessages.generated.json.lcl
+++ b/src/loc/lcl/ptb/diagnosticMessages/diagnosticMessages.generated.json.lcl
@@ -893,6 +893,15 @@
+ -
+
+
+
+
+
+
+
+
-
@@ -989,27 +998,15 @@
- -
+
-
-
+
-