mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Merge branch 'master' into createTypeNode
This commit is contained in:
+1
-1
@@ -749,7 +749,7 @@ gulp.task("browserify", "Runs browserify on run.js to produce a file suitable fo
|
||||
const originalMap = file.sourceMap;
|
||||
const prebundledContent = file.contents.toString();
|
||||
// Make paths absolute to help sorcery deal with all the terrible paths being thrown around
|
||||
originalMap.sources = originalMap.sources.map(s => path.resolve(s));
|
||||
originalMap.sources = originalMap.sources.map(s => path.resolve(path.join("src/harness", s)));
|
||||
// intoStream (below) makes browserify think the input file is named this, so this is what it puts in the sourcemap
|
||||
originalMap.file = "built/local/_stream_0.js";
|
||||
|
||||
|
||||
@@ -3863,6 +3863,9 @@ namespace ts {
|
||||
parseErrorAtPosition(openingTagName.pos, openingTagName.end - openingTagName.pos, Diagnostics.JSX_element_0_has_no_corresponding_closing_tag, getTextOfNodeFromSourceText(sourceText, openingTagName));
|
||||
break;
|
||||
}
|
||||
else if (token() === SyntaxKind.ConflictMarkerTrivia) {
|
||||
break;
|
||||
}
|
||||
result.push(parseJsxChild());
|
||||
}
|
||||
|
||||
|
||||
@@ -1716,7 +1716,14 @@ namespace ts {
|
||||
while (pos < end) {
|
||||
pos++;
|
||||
char = text.charCodeAt(pos);
|
||||
if ((char === CharacterCodes.openBrace) || (char === CharacterCodes.lessThan)) {
|
||||
if (char === CharacterCodes.openBrace) {
|
||||
break;
|
||||
}
|
||||
if (char === CharacterCodes.lessThan) {
|
||||
if (isConflictMarkerTrivia(text, pos)) {
|
||||
pos = scanConflictMarkerTrivia(text, pos, error);
|
||||
return token = SyntaxKind.ConflictMarkerTrivia;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -202,7 +202,7 @@ namespace ts {
|
||||
if (len >= 2 && buffer[0] === 0xFE && buffer[1] === 0xFF) {
|
||||
// Big endian UTF-16 byte order mark detected. Since big endian is not supported by node.js,
|
||||
// flip all byte pairs and treat as little endian.
|
||||
len &= ~1;
|
||||
len &= ~1; // Round down to a multiple of 2
|
||||
for (let i = 0; i < len; i += 2) {
|
||||
const temp = buffer[i];
|
||||
buffer[i] = buffer[i + 1];
|
||||
|
||||
@@ -89,7 +89,8 @@ namespace ts {
|
||||
startLexicalEnvironment();
|
||||
|
||||
const statements: Statement[] = [];
|
||||
const statementOffset = addPrologueDirectives(statements, node.statements, /*ensureUseStrict*/ !compilerOptions.noImplicitUseStrict, sourceElementVisitor);
|
||||
const ensureUseStrict = compilerOptions.alwaysStrict || (!compilerOptions.noImplicitUseStrict && isExternalModule(currentSourceFile));
|
||||
const statementOffset = addPrologueDirectives(statements, node.statements, ensureUseStrict, sourceElementVisitor);
|
||||
|
||||
if (shouldEmitUnderscoreUnderscoreESModule()) {
|
||||
append(statements, createUnderscoreUnderscoreESModule());
|
||||
|
||||
@@ -225,7 +225,8 @@ namespace ts {
|
||||
startLexicalEnvironment();
|
||||
|
||||
// Add any prologue directives.
|
||||
const statementOffset = addPrologueDirectives(statements, node.statements, /*ensureUseStrict*/ !compilerOptions.noImplicitUseStrict, sourceElementVisitor);
|
||||
const ensureUseStrict = compilerOptions.alwaysStrict || (!compilerOptions.noImplicitUseStrict && isExternalModule(currentSourceFile));
|
||||
const statementOffset = addPrologueDirectives(statements, node.statements, ensureUseStrict, sourceElementVisitor);
|
||||
|
||||
// var __moduleName = context_1 && context_1.id;
|
||||
statements.push(
|
||||
|
||||
@@ -3006,6 +3006,42 @@ namespace ts.projectSystem {
|
||||
const errorResult = <protocol.Diagnostic[]>session.executeCommand(dTsFileGetErrRequest).response;
|
||||
assert.isTrue(errorResult.length === 0);
|
||||
});
|
||||
|
||||
it("should be turned on for js-only external projects with skipLibCheck=false", () => {
|
||||
const jsFile = {
|
||||
path: "/a/b/file1.js",
|
||||
content: "let x =1;"
|
||||
};
|
||||
const dTsFile = {
|
||||
path: "/a/b/file2.d.ts",
|
||||
content: `
|
||||
interface T {
|
||||
name: string;
|
||||
};
|
||||
interface T {
|
||||
name: number;
|
||||
};`
|
||||
};
|
||||
const host = createServerHost([jsFile, dTsFile]);
|
||||
const session = createSession(host);
|
||||
|
||||
const openExternalProjectRequest = makeSessionRequest<protocol.OpenExternalProjectArgs>(
|
||||
CommandNames.OpenExternalProject,
|
||||
{
|
||||
projectFileName: "project1",
|
||||
rootFiles: toExternalFiles([jsFile.path, dTsFile.path]),
|
||||
options: { skipLibCheck: false }
|
||||
}
|
||||
);
|
||||
session.executeCommand(openExternalProjectRequest);
|
||||
|
||||
const dTsFileGetErrRequest = makeSessionRequest<protocol.SemanticDiagnosticsSyncRequestArgs>(
|
||||
CommandNames.SemanticDiagnosticsSync,
|
||||
{ file: dTsFile.path }
|
||||
);
|
||||
const errorResult = <protocol.Diagnostic[]>session.executeCommand(dTsFileGetErrRequest).response;
|
||||
assert.isTrue(errorResult.length === 0);
|
||||
});
|
||||
});
|
||||
|
||||
describe("non-existing directories listed in config file input array", () => {
|
||||
|
||||
@@ -26,14 +26,7 @@ namespace ts.server {
|
||||
}
|
||||
|
||||
function shouldSkipSematicCheck(project: Project) {
|
||||
if (project.getCompilerOptions().skipLibCheck !== undefined) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ((project.projectKind === ProjectKind.Inferred || project.projectKind === ProjectKind.External) && project.isJsOnlyProject()) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return (project.projectKind === ProjectKind.Inferred || project.projectKind === ProjectKind.External) && project.isJsOnlyProject();
|
||||
}
|
||||
|
||||
interface FileStart {
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
tests/cases/compiler/conflictMarkerTrivia3.tsx(1,11): error TS17004: Cannot use JSX unless the '--jsx' flag is provided.
|
||||
tests/cases/compiler/conflictMarkerTrivia3.tsx(1,16): error TS1005: '</' expected.
|
||||
tests/cases/compiler/conflictMarkerTrivia3.tsx(2,1): error TS1185: Merge conflict marker encountered.
|
||||
|
||||
|
||||
==== tests/cases/compiler/conflictMarkerTrivia3.tsx (3 errors) ====
|
||||
const x = <div>
|
||||
~~~~~
|
||||
!!! error TS17004: Cannot use JSX unless the '--jsx' flag is provided.
|
||||
|
||||
<<<<<<< HEAD
|
||||
~~~~~~~~~~~~
|
||||
!!! error TS1005: '</' expected.
|
||||
~~~~~~~
|
||||
!!! error TS1185: Merge conflict marker encountered.
|
||||
@@ -0,0 +1,6 @@
|
||||
//// [conflictMarkerTrivia3.tsx]
|
||||
const x = <div>
|
||||
<<<<<<< HEAD
|
||||
|
||||
//// [conflictMarkerTrivia3.js]
|
||||
var x = <div></>;
|
||||
@@ -0,0 +1,14 @@
|
||||
tests/cases/compiler/conflictMarkerTrivia4.ts(1,12): error TS2304: Cannot find name 'div'.
|
||||
tests/cases/compiler/conflictMarkerTrivia4.ts(2,1): error TS1185: Merge conflict marker encountered.
|
||||
tests/cases/compiler/conflictMarkerTrivia4.ts(2,13): error TS1109: Expression expected.
|
||||
|
||||
|
||||
==== tests/cases/compiler/conflictMarkerTrivia4.ts (3 errors) ====
|
||||
const x = <div>
|
||||
~~~
|
||||
!!! error TS2304: Cannot find name 'div'.
|
||||
<<<<<<< HEAD
|
||||
~~~~~~~
|
||||
!!! error TS1185: Merge conflict marker encountered.
|
||||
|
||||
!!! error TS1109: Expression expected.
|
||||
@@ -0,0 +1,6 @@
|
||||
//// [conflictMarkerTrivia4.ts]
|
||||
const x = <div>
|
||||
<<<<<<< HEAD
|
||||
|
||||
//// [conflictMarkerTrivia4.js]
|
||||
var x = ;
|
||||
@@ -68,7 +68,6 @@ C = tslib_1.__decorate([
|
||||
dec
|
||||
], C);
|
||||
//// [script.js]
|
||||
"use strict";
|
||||
var tslib_1 = require("tslib");
|
||||
var A = (function () {
|
||||
function A() {
|
||||
|
||||
@@ -5,5 +5,4 @@ run(1);
|
||||
|
||||
|
||||
//// [isolatedModulesPlainFile-CommonJS.js]
|
||||
"use strict";
|
||||
run(1);
|
||||
|
||||
@@ -6,7 +6,6 @@ run(1);
|
||||
|
||||
//// [isolatedModulesPlainFile-System.js]
|
||||
System.register([], function (exports_1, context_1) {
|
||||
"use strict";
|
||||
var __moduleName = context_1 && context_1.id;
|
||||
return {
|
||||
setters: [],
|
||||
|
||||
@@ -1,3 +1,2 @@
|
||||
"use strict";
|
||||
var x = 0;
|
||||
//# sourceMappingURL=file.js.map
|
||||
@@ -1,4 +1,3 @@
|
||||
"use strict";
|
||||
a;
|
||||
b;
|
||||
//# sourceMappingURL=file.js.map
|
||||
-1
@@ -1,4 +1,3 @@
|
||||
"use strict";
|
||||
/// <reference path="file2.ts" />
|
||||
var x = 0;
|
||||
//# sourceMappingURL=file.js.map
|
||||
@@ -1,3 +1,2 @@
|
||||
"use strict";
|
||||
var x = 0;
|
||||
//# sourceMappingURL=file.js.map
|
||||
-1
@@ -1,2 +1 @@
|
||||
"use strict";
|
||||
//# sourceMappingURL=file.js.map
|
||||
-1
@@ -1,2 +1 @@
|
||||
"use strict";
|
||||
//# sourceMappingURL=file.js.map
|
||||
@@ -1,5 +1,4 @@
|
||||
System.register("NamedModule", [], function (exports_1, context_1) {
|
||||
"use strict";
|
||||
var __moduleName = context_1 && context_1.id;
|
||||
var x;
|
||||
return {
|
||||
|
||||
@@ -1,3 +1,2 @@
|
||||
"use strict";
|
||||
var a = 10;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@@ -1,3 +1,2 @@
|
||||
"use strict";
|
||||
var a = 10;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@@ -1,3 +1,2 @@
|
||||
"use strict";
|
||||
var x;
|
||||
//# sourceMappingURL=b.js.map
|
||||
@@ -1,3 +1,2 @@
|
||||
"use strict";
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@@ -1,3 +1,2 @@
|
||||
"use strict";
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@@ -1,3 +1,2 @@
|
||||
"use strict";
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@@ -1,3 +1,2 @@
|
||||
"use strict";
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@@ -1,3 +1,2 @@
|
||||
"use strict";
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@@ -1,3 +1,2 @@
|
||||
"use strict";
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@@ -1,3 +1,2 @@
|
||||
"use strict";
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@@ -1,3 +1,2 @@
|
||||
"use strict";
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@@ -1,3 +1,2 @@
|
||||
"use strict";
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@@ -1,3 +1,2 @@
|
||||
"use strict";
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@@ -1,3 +1,2 @@
|
||||
"use strict";
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
-1
@@ -1,3 +1,2 @@
|
||||
"use strict";
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@@ -1,3 +1,2 @@
|
||||
"use strict";
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@@ -1,3 +1,2 @@
|
||||
"use strict";
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@@ -1,3 +1,2 @@
|
||||
"use strict";
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@@ -1,3 +1,2 @@
|
||||
"use strict";
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@@ -1,3 +1,2 @@
|
||||
"use strict";
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@@ -1,3 +1,2 @@
|
||||
"use strict";
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@@ -1,3 +1,2 @@
|
||||
"use strict";
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@@ -1,3 +1,2 @@
|
||||
"use strict";
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@@ -1,3 +1,2 @@
|
||||
"use strict";
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@@ -1,3 +1,2 @@
|
||||
"use strict";
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@@ -1,3 +1,2 @@
|
||||
"use strict";
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@@ -1,3 +1,2 @@
|
||||
"use strict";
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@@ -1,3 +1,2 @@
|
||||
"use strict";
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@@ -1,3 +1,2 @@
|
||||
"use strict";
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@@ -1,3 +1,2 @@
|
||||
"use strict";
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@@ -1,3 +1,2 @@
|
||||
"use strict";
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@@ -1,3 +1,2 @@
|
||||
"use strict";
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@@ -1,3 +1,2 @@
|
||||
"use strict";
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@@ -1,3 +1,2 @@
|
||||
"use strict";
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@@ -1,3 +1,2 @@
|
||||
"use strict";
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@@ -1,3 +1,2 @@
|
||||
"use strict";
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@@ -1,3 +1,2 @@
|
||||
"use strict";
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@@ -1,3 +1,2 @@
|
||||
"use strict";
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@@ -1,3 +1,2 @@
|
||||
"use strict";
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@@ -1,3 +1,2 @@
|
||||
"use strict";
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@@ -1,3 +1,2 @@
|
||||
"use strict";
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@@ -1,3 +1,2 @@
|
||||
"use strict";
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@@ -1,3 +1,2 @@
|
||||
"use strict";
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@@ -1,3 +1,2 @@
|
||||
"use strict";
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@@ -1,3 +1,2 @@
|
||||
"use strict";
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@@ -1,3 +1,2 @@
|
||||
"use strict";
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@@ -1,3 +1,2 @@
|
||||
"use strict";
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@@ -1,3 +1,2 @@
|
||||
"use strict";
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@@ -1,3 +1,2 @@
|
||||
"use strict";
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@@ -1,3 +1,2 @@
|
||||
"use strict";
|
||||
x;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@@ -1,3 +1,2 @@
|
||||
"use strict";
|
||||
var x;
|
||||
//# sourceMappingURL=file.js.map
|
||||
@@ -1,3 +1,2 @@
|
||||
"use strict";
|
||||
var x = 0;
|
||||
//# sourceMappingURL=file.js.map
|
||||
@@ -1,3 +1,2 @@
|
||||
"use strict";
|
||||
var a = 10;
|
||||
//# sourceMappingURL=input.js.map
|
||||
@@ -1,3 +1,2 @@
|
||||
"use strict";
|
||||
var x = React.createElement("div", null);
|
||||
//# sourceMappingURL=file.js.map
|
||||
@@ -0,0 +1,2 @@
|
||||
const x = <div>
|
||||
<<<<<<< HEAD
|
||||
@@ -0,0 +1,2 @@
|
||||
const x = <div>
|
||||
<<<<<<< HEAD
|
||||
Reference in New Issue
Block a user