mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-08 12:55:49 -05:00
Update baseline: emit prologue directives before anything else
This commit is contained in:
@@ -34,12 +34,12 @@ compile(process.argv.slice(2), {
|
||||
});
|
||||
|
||||
//// [APISample_compile.js]
|
||||
"use strict";
|
||||
/*
|
||||
* Note: This test is a public API sample. The sample sources can be found
|
||||
at: https://github.com/Microsoft/TypeScript/wiki/Using-the-Compiler-API#a-minimal-compiler
|
||||
* Please log a "breaking change" issue for any API breaking change affecting this issue
|
||||
*/
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
var ts = require("typescript");
|
||||
function compile(fileNames, options) {
|
||||
|
||||
@@ -64,12 +64,12 @@ fileNames.forEach(fileName => {
|
||||
});
|
||||
|
||||
//// [APISample_linter.js]
|
||||
"use strict";
|
||||
/*
|
||||
* Note: This test is a public API sample. The sample sources can be found
|
||||
at: https://github.com/Microsoft/TypeScript/wiki/Using-the-Compiler-API#traversing-the-ast-with-a-little-linter
|
||||
* Please log a "breaking change" issue for any API breaking change affecting this issue
|
||||
*/
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
var ts = require("typescript");
|
||||
function delint(sourceFile) {
|
||||
|
||||
@@ -36,12 +36,12 @@ export function createProgram(rootFiles: string[], compilerOptionsJson: string):
|
||||
}
|
||||
|
||||
//// [APISample_parseConfig.js]
|
||||
"use strict";
|
||||
/*
|
||||
* Note: This test is a public API sample. The sample sources can be found
|
||||
at: https://github.com/Microsoft/TypeScript/wiki/Using-the-Compiler-API#a-minimal-compiler
|
||||
* Please log a "breaking change" issue for any API breaking change affecting this issue
|
||||
*/
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
var ts = require("typescript");
|
||||
function printError(error) {
|
||||
|
||||
@@ -16,12 +16,12 @@ let result = ts.transpile(source, { module: ts.ModuleKind.CommonJS });
|
||||
console.log(JSON.stringify(result));
|
||||
|
||||
//// [APISample_transform.js]
|
||||
"use strict";
|
||||
/*
|
||||
* Note: This test is a public API sample. The sample sources can be found
|
||||
at: https://github.com/Microsoft/TypeScript/wiki/Using-the-Compiler-API#a-simple-transform-function
|
||||
* Please log a "breaking change" issue for any API breaking change affecting this issue
|
||||
*/
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
var ts = require("typescript");
|
||||
var source = "let x: string = 'string'";
|
||||
|
||||
@@ -109,12 +109,12 @@ const currentDirectoryFiles = fs.readdirSync(process.cwd()).
|
||||
watch(currentDirectoryFiles, { module: ts.ModuleKind.CommonJS });
|
||||
|
||||
//// [APISample_watcher.js]
|
||||
"use strict";
|
||||
/*
|
||||
* Note: This test is a public API sample. The sample sources can be found
|
||||
at: https://github.com/Microsoft/TypeScript/wiki/Using-the-Compiler-API#incremental-build-support-using-the-language-services
|
||||
* Please log a "breaking change" issue for any API breaking change affecting this issue
|
||||
*/
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
var ts = require("typescript");
|
||||
function watch(rootFileNames, options) {
|
||||
|
||||
@@ -23,7 +23,6 @@ var M;
|
||||
}
|
||||
M.f = f;
|
||||
})(M || (M = {}));
|
||||
"use strict";
|
||||
var M;
|
||||
(function (M) {
|
||||
function f2() {
|
||||
|
||||
@@ -5,8 +5,8 @@ import m1 = require("m2")
|
||||
m1.f();
|
||||
|
||||
//// [amdDependencyComment1.js]
|
||||
///<amd-dependency path='bar'/>
|
||||
"use strict";
|
||||
///<amd-dependency path='bar'/>
|
||||
exports.__esModule = true;
|
||||
var m1 = require("m2");
|
||||
m1.f();
|
||||
|
||||
@@ -5,8 +5,8 @@ import m1 = require("m2")
|
||||
m1.f();
|
||||
|
||||
//// [amdDependencyCommentName1.js]
|
||||
///<amd-dependency path='bar' name='b'/>
|
||||
"use strict";
|
||||
///<amd-dependency path='bar' name='b'/>
|
||||
exports.__esModule = true;
|
||||
var m1 = require("m2");
|
||||
m1.f();
|
||||
|
||||
@@ -5,6 +5,6 @@
|
||||
import foo = require('./foo');
|
||||
|
||||
//// [commentOnImportStatement3.js]
|
||||
/* copyright */
|
||||
"use strict";
|
||||
/* copyright */
|
||||
exports.__esModule = true;
|
||||
|
||||
@@ -560,8 +560,8 @@ export function viewFactory_AppComponent0(viewUtils:any,parentInjector:any,decla
|
||||
|
||||
|
||||
//// [complexNarrowingWithAny.js]
|
||||
// Repro from #10869
|
||||
"use strict";
|
||||
// Repro from #10869
|
||||
exports.__esModule = true;
|
||||
/**
|
||||
* This file is generated by the Angular 2 template compiler.
|
||||
|
||||
@@ -149,8 +149,8 @@ export class StyleParser {
|
||||
}
|
||||
|
||||
//// [controlFlowPropertyDeclarations.js]
|
||||
// Repro from ##8913
|
||||
"use strict";
|
||||
// Repro from ##8913
|
||||
exports.__esModule = true;
|
||||
var HTMLDOMPropertyConfig = require('react/lib/HTMLDOMPropertyConfig');
|
||||
// Populate property map with ReactJS's attribute and property mappings
|
||||
|
||||
@@ -101,8 +101,8 @@ function md5(string:string): void {
|
||||
export default md5;
|
||||
|
||||
//// [controlFlowSelfReferentialLoop.js]
|
||||
// Repro from #12319
|
||||
"use strict";
|
||||
// Repro from #12319
|
||||
exports.__esModule = true;
|
||||
function md5(string) {
|
||||
function FF(a, b, c, d, x, s, ac) {
|
||||
|
||||
@@ -207,8 +207,8 @@ export * from "class-module";
|
||||
|
||||
|
||||
//// [main.js]
|
||||
/// <reference path="modules.d.ts"/>
|
||||
"use strict";
|
||||
/// <reference path="modules.d.ts"/>
|
||||
function __export(m) {
|
||||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
||||
}
|
||||
|
||||
@@ -18,8 +18,8 @@ const x: B = { c: B };
|
||||
|
||||
|
||||
//// [a.js]
|
||||
// This test is just like exportEqualsProperty2, but with `export default`.
|
||||
"use strict";
|
||||
// This test is just like exportEqualsProperty2, but with `export default`.
|
||||
exports.__esModule = true;
|
||||
var C = (function () {
|
||||
function C() {
|
||||
|
||||
@@ -18,8 +18,8 @@ const x: B = { c: B };
|
||||
|
||||
|
||||
//// [a.js]
|
||||
// This test is just like exportDefaultProperty2, but with `export =`.
|
||||
"use strict";
|
||||
// This test is just like exportDefaultProperty2, but with `export =`.
|
||||
var C = (function () {
|
||||
function C() {
|
||||
}
|
||||
|
||||
@@ -9,8 +9,8 @@ export const Form3 = brokenFunction(parameterFn)({store: "hello"})
|
||||
|
||||
|
||||
//// [intersectionTypeInference1.js]
|
||||
// Repro from #8801
|
||||
"use strict";
|
||||
// Repro from #8801
|
||||
exports.__esModule = true;
|
||||
function alert(s) { }
|
||||
var parameterFn = function (props) { return alert(props.store); };
|
||||
|
||||
@@ -27,8 +27,8 @@ x.foo().x;
|
||||
|
||||
|
||||
//// [main.js]
|
||||
/// <reference path="O.d.ts" />
|
||||
"use strict";
|
||||
/// <reference path="O.d.ts" />
|
||||
exports.__esModule = true;
|
||||
var x;
|
||||
x.foo().x;
|
||||
|
||||
@@ -28,8 +28,8 @@ x.foo().x;
|
||||
|
||||
|
||||
//// [main.js]
|
||||
/// <reference path="O.d.ts" />
|
||||
"use strict";
|
||||
/// <reference path="O.d.ts" />
|
||||
exports.__esModule = true;
|
||||
require("Map");
|
||||
var x;
|
||||
|
||||
@@ -38,8 +38,8 @@ x.foo2().x2;
|
||||
|
||||
|
||||
//// [main.js]
|
||||
/// <reference path="O.d.ts" />
|
||||
"use strict";
|
||||
/// <reference path="O.d.ts" />
|
||||
exports.__esModule = true;
|
||||
require("Map");
|
||||
var x;
|
||||
|
||||
@@ -40,9 +40,9 @@ x.foo2().x2;
|
||||
|
||||
|
||||
//// [main.js]
|
||||
"use strict";
|
||||
/// <reference path="O.d.ts" />
|
||||
/// <reference path="O2.d.ts" />
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
require("Map");
|
||||
var x;
|
||||
|
||||
@@ -40,9 +40,9 @@ tsc app.ts # Should write to library-a/index.js, library-b/index.js, and app.js
|
||||
|
||||
|
||||
//// [/src/library-a/index.js]
|
||||
"use strict";
|
||||
// When symlinked files are in node_modules, they are resolved with realpath;
|
||||
// so a linked file does not create a duplicate SourceFile of the real one.
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
var MyClass = (function () {
|
||||
function MyClass() {
|
||||
|
||||
@@ -14,17 +14,17 @@ x + x2;
|
||||
|
||||
|
||||
//// [/src/bin/shared/abc.js]
|
||||
"use strict";
|
||||
// When symlinked files are not in node_modules, realpath is not used.
|
||||
// A symlink file acts like the real thing. So, 2 symlinks act like 2 different files.
|
||||
// See GH#10364.
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
exports.x = 0;
|
||||
//// [/src/bin/shared2/abc.js]
|
||||
"use strict";
|
||||
// When symlinked files are not in node_modules, realpath is not used.
|
||||
// A symlink file acts like the real thing. So, 2 symlinks act like 2 different files.
|
||||
// See GH#10364.
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
exports.x = 0;
|
||||
//// [/src/bin/app.js]
|
||||
|
||||
@@ -20,8 +20,8 @@ y = x;
|
||||
|
||||
|
||||
//// [/src/bin/library-a/index.js]
|
||||
// Same as moduleResolutionWithSymlinks.ts, but with outDir
|
||||
"use strict";
|
||||
// Same as moduleResolutionWithSymlinks.ts, but with outDir
|
||||
exports.__esModule = true;
|
||||
var MyClass = (function () {
|
||||
function MyClass() {
|
||||
|
||||
@@ -17,8 +17,8 @@ export function speak<TPet extends Pet>(pet: TPet, voice: (pet: TPet) => string)
|
||||
}
|
||||
|
||||
//// [narrowingConstrainedTypeParameter.js]
|
||||
// Repro from #10811
|
||||
"use strict";
|
||||
// Repro from #10811
|
||||
exports.__esModule = true;
|
||||
function isPet(pet) {
|
||||
return typeof pet.name === "string";
|
||||
|
||||
@@ -29,8 +29,8 @@ var file3_1 = require("./file3"); // found with baseurl
|
||||
var file4_1 = require("file4"); // found with fallback
|
||||
exports.x = file3_1.x + file4_1.y;
|
||||
//// [file1.js]
|
||||
// baseUrl set via command line
|
||||
"use strict";
|
||||
// baseUrl set via command line
|
||||
exports.__esModule = true;
|
||||
var file2_1 = require("folder2/file2");
|
||||
use(file2_1.x.toExponential());
|
||||
|
||||
@@ -10,6 +10,6 @@ import fs = require('./requireOfAnEmptyFile1_b');
|
||||
|
||||
//// [requireOfAnEmptyFile1_b.js]
|
||||
//// [requireOfAnEmptyFile1_a.js]
|
||||
//requireOfAnEmptyFile1
|
||||
"use strict";
|
||||
//requireOfAnEmptyFile1
|
||||
exports.__esModule = true;
|
||||
|
||||
@@ -122,8 +122,8 @@ function f6() {
|
||||
|
||||
|
||||
//// [typeGuardsAsAssertions.js]
|
||||
// Repro from #8513
|
||||
"use strict";
|
||||
// Repro from #8513
|
||||
exports.__esModule = true;
|
||||
var cond;
|
||||
exports.none = { none: '' };
|
||||
|
||||
@@ -24,9 +24,9 @@ else {
|
||||
}
|
||||
|
||||
//// [typeGuardsInExternalModule.js]
|
||||
"use strict";
|
||||
// Note that type guards affect types of variables and parameters only and
|
||||
// have no effect on members of objects such as properties.
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
// local variable in external module
|
||||
var num;
|
||||
|
||||
@@ -22,8 +22,8 @@ export function y(arg: Type): void {
|
||||
}
|
||||
|
||||
//// [typePredicateInLoop.js]
|
||||
// Repro from #12101
|
||||
"use strict";
|
||||
// Repro from #12101
|
||||
exports.__esModule = true;
|
||||
var guard = function (arg) { return arg.type === 1; };
|
||||
var otherFunc = function (arg1, arg2) { };
|
||||
|
||||
@@ -15,8 +15,8 @@ export let x: typeof $;
|
||||
export let y = () => x
|
||||
|
||||
//// [app.js]
|
||||
/// <reference types="lib"/>
|
||||
"use strict";
|
||||
/// <reference types="lib"/>
|
||||
exports.__esModule = true;
|
||||
exports.$ = 1;
|
||||
exports.y = function () { return exports.x; };
|
||||
|
||||
@@ -41,8 +41,8 @@ var Cls = (function () {
|
||||
}());
|
||||
exports.Cls = Cls;
|
||||
//// [mod1.js]
|
||||
/// <reference types="lib" />
|
||||
"use strict";
|
||||
/// <reference types="lib" />
|
||||
exports.__esModule = true;
|
||||
var main_1 = require("./main");
|
||||
main_1.Cls.prototype.foo = function () { return undefined; };
|
||||
|
||||
@@ -29,8 +29,8 @@ function run(configuration: commands.IConfiguration) {
|
||||
"use strict";
|
||||
exports.__esModule = true;
|
||||
//// [visibilityOfCrossModuleTypeUsage_commands.js]
|
||||
//visibilityOfCrossModuleTypeUsage
|
||||
"use strict";
|
||||
//visibilityOfCrossModuleTypeUsage
|
||||
exports.__esModule = true;
|
||||
//// [visibilityOfCrossModuleTypeUsage_fs.js]
|
||||
"use strict";
|
||||
|
||||
Reference in New Issue
Block a user