mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-11-18 20:11:14 +00:00
Merge branch 'master' into gulpProjectRefs
This commit is contained in:
commit
21c23d4e4e
820 files changed
+5822
-3299
No files matched your search
@@ -390,19 +390,24 @@ namespace ts {
|
||||
const firstLineColumnOffset = writer.getColumn();
|
||||
// First, decode the old component sourcemap
|
||||
const originalMap = parsed;
|
||||
|
||||
const sourcesDirectoryPath = compilerOptions.sourceRoot ? host.getCommonSourceDirectory() : sourceMapDir;
|
||||
const resolvedPathCache = createMap<string>();
|
||||
sourcemaps.calculateDecodedMappings(originalMap, (raw): void => {
|
||||
// Apply offsets to each position and fixup source entries
|
||||
const rawPath = originalMap.sources[raw.sourceIndex];
|
||||
const relativePath = originalMap.sourceRoot ? combinePaths(originalMap.sourceRoot, rawPath) : rawPath;
|
||||
const combinedPath = combinePaths(getDirectoryPath(node.sourceMapPath!), relativePath);
|
||||
const sourcesDirectoryPath = compilerOptions.sourceRoot ? host.getCommonSourceDirectory() : sourceMapDir;
|
||||
const resolvedPath = getRelativePathToDirectoryOrUrl(
|
||||
sourcesDirectoryPath,
|
||||
combinedPath,
|
||||
host.getCurrentDirectory(),
|
||||
host.getCanonicalFileName,
|
||||
/*isAbsolutePathAnUrl*/ true
|
||||
);
|
||||
if (!resolvedPathCache.has(combinedPath)) {
|
||||
resolvedPathCache.set(combinedPath, getRelativePathToDirectoryOrUrl(
|
||||
sourcesDirectoryPath,
|
||||
combinedPath,
|
||||
host.getCurrentDirectory(),
|
||||
host.getCanonicalFileName,
|
||||
/*isAbsolutePathAnUrl*/ true
|
||||
));
|
||||
}
|
||||
const resolvedPath = resolvedPathCache.get(combinedPath)!;
|
||||
const absolutePath = getNormalizedAbsolutePath(resolvedPath, sourcesDirectoryPath);
|
||||
// tslint:disable-next-line:no-null-keyword
|
||||
setupSourceEntry(absolutePath, originalMap.sourcesContent ? originalMap.sourcesContent[raw.sourceIndex] : null); // TODO: Lookup content for inlining?
|
||||
|
||||
@@ -4067,9 +4067,13 @@ namespace ts {
|
||||
priority: 0,
|
||||
text: `
|
||||
var __extends = (this && this.__extends) || (function () {
|
||||
var extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
||||
var extendStatics = function (d, b) {
|
||||
extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
||||
return extendStatics(d, b);
|
||||
}
|
||||
|
||||
return function (d, b) {
|
||||
extendStatics(d, b);
|
||||
function __() { this.constructor = d; }
|
||||
|
||||
@@ -890,13 +890,16 @@ namespace ts {
|
||||
scoped: false,
|
||||
priority: 1,
|
||||
text: `
|
||||
var __assign = (this && this.__assign) || Object.assign || function(t) {
|
||||
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
||||
s = arguments[i];
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
||||
t[p] = s[p];
|
||||
}
|
||||
return t;
|
||||
var __assign = (this && this.__assign) || function () {
|
||||
__assign = Object.assign || function(t) {
|
||||
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
||||
s = arguments[i];
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
||||
t[p] = s[p];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
return __assign.apply(this, arguments);
|
||||
};`
|
||||
};
|
||||
|
||||
|
||||
@@ -1118,6 +1118,7 @@ namespace ts {
|
||||
|
||||
let pseudoUpToDate = false;
|
||||
let usesPrepend = false;
|
||||
let upstreamChangedProject: string | undefined;
|
||||
if (project.projectReferences && host.parseConfigFile) {
|
||||
for (const ref of project.projectReferences) {
|
||||
usesPrepend = usesPrepend || !!(ref.prepend);
|
||||
@@ -1150,6 +1151,7 @@ namespace ts {
|
||||
// *after* those files, then we're "psuedo up to date" and eligible for a fast rebuild
|
||||
if (refStatus.newestDeclarationFileContentChangedTime <= oldestOutputFileTime) {
|
||||
pseudoUpToDate = true;
|
||||
upstreamChangedProject = ref.path;
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -1178,8 +1180,12 @@ namespace ts {
|
||||
};
|
||||
}
|
||||
|
||||
if (usesPrepend) {
|
||||
pseudoUpToDate = false;
|
||||
if (usesPrepend && pseudoUpToDate) {
|
||||
return {
|
||||
type: UpToDateStatusType.OutOfDateWithUpstream,
|
||||
outOfDateOutputFileName: oldestOutputFileName,
|
||||
newerProjectName: upstreamChangedProject!
|
||||
};
|
||||
}
|
||||
|
||||
// Up to date
|
||||
|
||||
Reference in new issue
Block a user