Hoisted declarations should occur after prologue directives (#24386)

This commit is contained in:
Wesley Wigham 2018-05-24 12:49:02 -07:00 committed by Wesley Wigham
parent a7b7b3c2ad
commit 246465e251
No known key found for this signature in database
GPG Key ID: D59F87F60C5400C9
85 changed files with 129 additions and 125 deletions

View File

@ -977,21 +977,6 @@ namespace ts {
return to;
}
/**
* Appends a range of value to begin of an array, returning the array.
*
* @param to The array to which `value` is to be appended. If `to` is `undefined`, a new array
* is created if `value` was appended.
* @param from The values to append to the array. If `from` is `undefined`, nothing is
* appended. If an element of `from` is `undefined`, that element is not appended.
*/
export function prependRange<T>(to: T[], from: ReadonlyArray<T> | undefined): T[] | undefined {
if (from === undefined || from.length === 0) return to;
if (to === undefined) return from.slice();
to.unshift(...from);
return to;
}
/**
* @return Whether the value was added.
*/

View File

@ -529,7 +529,7 @@ namespace ts {
createVariableStatement(/*modifiers*/ undefined,
createVariableDeclarationList(taggedTemplateStringDeclarations)));
}
prependRange(statements, endLexicalEnvironment());
prependStatements(statements, endLexicalEnvironment());
exitSubtree(ancestorFacts, HierarchyFacts.None, HierarchyFacts.None);
return updateSourceFileNode(
node,
@ -836,7 +836,7 @@ namespace ts {
setEmitFlags(statement, EmitFlags.NoComments | EmitFlags.NoTokenSourceMaps);
statements.push(statement);
prependRange(statements, endLexicalEnvironment());
prependStatements(statements, endLexicalEnvironment());
const block = createBlock(setTextRange(createNodeArray(statements), /*location*/ node.members), /*multiLine*/ true);
setEmitFlags(block, EmitFlags.NoComments);
@ -979,7 +979,7 @@ namespace ts {
);
}
prependRange(statements, endLexicalEnvironment());
prependStatements(statements, endLexicalEnvironment());
if (constructor) {
prependCaptureNewTargetIfNeeded(statements, constructor, /*copyOnWrite*/ false);
@ -1895,7 +1895,7 @@ namespace ts {
}
const lexicalEnvironment = context.endLexicalEnvironment();
prependRange(statements, lexicalEnvironment);
prependStatements(statements, lexicalEnvironment);
prependCaptureNewTargetIfNeeded(statements, node, /*copyOnWrite*/ false);
@ -2713,7 +2713,7 @@ namespace ts {
if (loopOutParameters.length) {
copyOutParameters(loopOutParameters, CopyDirection.ToOutParameter, statements);
}
prependRange(statements, lexicalEnvironment);
prependStatements(statements, lexicalEnvironment);
loopBody = createBlock(statements, /*multiline*/ true);
}

View File

@ -412,7 +412,7 @@ namespace ts {
)
);
prependRange(statements, endLexicalEnvironment());
prependStatements(statements, endLexicalEnvironment());
const block = createBlock(statements, /*multiLine*/ true);
setTextRange(block, node.body);

View File

@ -663,7 +663,7 @@ namespace ts {
)
);
prependRange(statements, endLexicalEnvironment());
prependStatements(statements, endLexicalEnvironment());
const block = updateBlock(node.body, statements);
// Minor optimization, emit `_super` helper to capture `super` access in an arrow.
@ -695,7 +695,7 @@ namespace ts {
const leadingStatements = endLexicalEnvironment();
if (statementOffset > 0 || some(statements) || some(leadingStatements)) {
const block = convertToFunctionBody(body, /*multiLine*/ true);
prependRange(statements, leadingStatements);
prependStatements(statements, leadingStatements);
addRange(statements, block.statements.slice(statementOffset));
return updateBlock(block, setTextRange(createNodeArray(statements), block.statements));
}

View File

@ -586,7 +586,7 @@ namespace ts {
transformAndEmitStatements(body.statements, statementOffset);
const buildResult = build();
prependRange(statements, endLexicalEnvironment());
prependStatements(statements, endLexicalEnvironment());
statements.push(createReturn(buildResult));
// Restore previous generator state

View File

@ -97,7 +97,7 @@ namespace ts {
append(statements, visitNode(currentModuleInfo.externalHelpersImportDeclaration, sourceElementVisitor, isStatement));
addRange(statements, visitNodes(node.statements, sourceElementVisitor, isStatement, statementOffset));
addExportEqualsIfNeeded(statements, /*emitAsReturn*/ false);
prependRange(statements, endLexicalEnvironment());
prependStatements(statements, endLexicalEnvironment());
const updated = updateSourceFileNode(node, setTextRange(createNodeArray(statements), node.statements));
if (currentModuleInfo.hasExportStarsToExportValues && !compilerOptions.importHelpers) {
@ -426,7 +426,7 @@ namespace ts {
// End the lexical environment for the module body
// and merge any new lexical declarations.
prependRange(statements, endLexicalEnvironment());
prependStatements(statements, endLexicalEnvironment());
const body = createBlock(statements, /*multiLine*/ true);
if (currentModuleInfo.hasExportStarsToExportValues && !compilerOptions.importHelpers) {

View File

@ -257,7 +257,7 @@ namespace ts {
// We emit hoisted variables early to align roughly with our previous emit output.
// Two key differences in this approach are:
// - Temporary variables will appear at the top rather than at the bottom of the file
prependRange(statements, endLexicalEnvironment());
prependStatements(statements, endLexicalEnvironment());
const exportStarFunction = addExportStarIfNeeded(statements);
const moduleObject = createObjectLiteral([

View File

@ -669,7 +669,7 @@ namespace ts {
setEmitFlags(statement, EmitFlags.NoComments | EmitFlags.NoTokenSourceMaps);
statements.push(statement);
prependRange(statements, context.endLexicalEnvironment());
prependStatements(statements, context.endLexicalEnvironment());
const iife = createImmediatelyInvokedArrowFunction(statements);
setEmitFlags(iife, EmitFlags.TypeScriptClassWrapper);
@ -2693,7 +2693,7 @@ namespace ts {
const statements: Statement[] = [];
startLexicalEnvironment();
const members = map(node.members, transformEnumMember);
prependRange(statements, endLexicalEnvironment());
prependStatements(statements, endLexicalEnvironment());
addRange(statements, members);
currentNamespaceContainerName = savedCurrentNamespaceLocalName;
@ -3008,7 +3008,7 @@ namespace ts {
statementsLocation = moveRangePos(moduleBlock.statements, -1);
}
prependRange(statements, endLexicalEnvironment());
prependStatements(statements, endLexicalEnvironment());
currentNamespaceContainerName = savedCurrentNamespaceContainerName;
currentNamespace = savedCurrentNamespace;
currentScopeFirstDeclarationsOfName = savedCurrentScopeFirstDeclarationsOfName;

View File

@ -252,6 +252,25 @@ namespace ts {
return !nodeIsMissing(node);
}
/**
* Appends a range of value to begin of an array, returning the array.
*
* @param to The array to which `value` is to be appended. If `to` is `undefined`, a new array
* is created if `value` was appended.
* @param from The values to append to the array. If `from` is `undefined`, nothing is
* appended. If an element of `from` is `undefined`, that element is not appended.
*/
export function prependStatements<T extends Statement>(to: T[], from: ReadonlyArray<T> | undefined): T[] | undefined {
if (from === undefined || from.length === 0) return to;
if (to === undefined) return from.slice();
const prologue = to.length && isPrologueDirective(to[0]) && to.shift();
to.unshift(...from);
if (prologue) {
to.unshift(prologue);
}
return to;
}
/**
* Determine if the given comment is a triple-slash
*

View File

@ -1469,7 +1469,7 @@ namespace ts {
return isNodeArray(statements)
? setTextRange(createNodeArray(concatenate(declarations, statements)), statements)
: prependRange(statements, declarations);
: prependStatements(statements, declarations);
}
/**

View File

@ -19,8 +19,8 @@ for (; ;) {
//// [SystemModuleForStatementNoInitializer.js]
System.register([], function (exports_1, context_1) {
var i, limit;
"use strict";
var i, limit;
var __moduleName = context_1 && context_1.id;
return {
setters: [],

View File

@ -17,8 +17,8 @@ module M {
//// [aliasesInSystemModule1.js]
System.register(["foo"], function (exports_1, context_1) {
var alias, cls, cls2, x, y, z, M;
"use strict";
var alias, cls, cls2, x, y, z, M;
var __moduleName = context_1 && context_1.id;
return {
setters: [

View File

@ -16,8 +16,8 @@ module M {
//// [aliasesInSystemModule2.js]
System.register(["foo"], function (exports_1, context_1) {
var foo_1, cls, cls2, x, y, z, M;
"use strict";
var foo_1, cls, cls2, x, y, z, M;
var __moduleName = context_1 && context_1.id;
return {
setters: [

View File

@ -11,8 +11,8 @@ export class Foo {
//// [a.js]
System.register(["./b"], function (exports_1, context_1) {
var b_1, x;
"use strict";
var b_1, x;
var __moduleName = context_1 && context_1.id;
return {
setters: [

View File

@ -12,8 +12,8 @@ export class Foo {
//// [b.js]
System.register([], function (exports_1, context_1) {
var Foo;
"use strict";
var Foo;
var __moduleName = context_1 && context_1.id;
return {
setters: [],
@ -29,8 +29,8 @@ System.register([], function (exports_1, context_1) {
});
//// [a.js]
System.register(["./b"], function (exports_1, context_1) {
var b_1, x;
"use strict";
var b_1, x;
var __moduleName = context_1 && context_1.id;
return {
setters: [

View File

@ -13,8 +13,8 @@ export var x = new Foo();
//// [a.js]
System.register(["./b"], function (exports_1, context_1) {
var b_1, x;
"use strict";
var b_1, x;
var __moduleName = context_1 && context_1.id;
return {
setters: [

View File

@ -13,8 +13,8 @@ export var x = new Foo();
//// [a.js]
System.register(["./b"], function (exports_1, context_1) {
var b_1, x;
"use strict";
var b_1, x;
var __moduleName = context_1 && context_1.id;
return {
setters: [

View File

@ -12,8 +12,8 @@ Foo.foo();
//// [a.js]
System.register(["./b"], function (exports_1, context_1) {
var b_1;
"use strict";
var b_1;
var __moduleName = context_1 && context_1.id;
return {
setters: [

View File

@ -12,8 +12,8 @@ Foo.foo();
//// [a.js]
System.register(["./b"], function (exports_1, context_1) {
var b_1;
"use strict";
var b_1;
var __moduleName = context_1 && context_1.id;
return {
setters: [

View File

@ -8,8 +8,8 @@ export default function() {}
//// [a.js]
System.register([], function (exports_1, context_1) {
var default_1;
"use strict";
var default_1;
var __moduleName = context_1 && context_1.id;
return {
setters: [],

View File

@ -144,8 +144,8 @@ for (const y = 0; y < 1;) {
//// [capturedLetConstInLoop4.js]
System.register([], function (exports_1, context_1) {
var v0, v00, v1, v2, v3, v4, v5, v6, v7, v8, v0_c, v00_c, v1_c, v2_c, v3_c, v4_c, v5_c, v6_c, v7_c, v8_c;
"use strict";
var v0, v00, v1, v2, v3, v4, v5, v6, v7, v8, v0_c, v00_c, v1_c, v2_c, v3_c, v4_c, v5_c, v6_c, v7_c, v8_c;
var __moduleName = context_1 && context_1.id;
//======let
function exportedFoo() {

View File

@ -9,6 +9,7 @@ export class Testing123 {
//// [a.js]
System.register([], function (exports_1, context_1) {
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@ -16,7 +17,6 @@ System.register([], function (exports_1, context_1) {
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var Testing123_1, Testing123;
"use strict";
var __moduleName = context_1 && context_1.id;
return {
setters: [],

View File

@ -6,6 +6,7 @@ export class Testing123 { }
//// [a.js]
System.register([], function (exports_1, context_1) {
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@ -13,7 +14,6 @@ System.register([], function (exports_1, context_1) {
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var Testing123_1, Testing123;
"use strict";
var __moduleName = context_1 && context_1.id;
return {
setters: [],

View File

@ -14,6 +14,7 @@ export default class {}
//// [a.js]
System.register([], function (exports_1, context_1) {
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@ -21,7 +22,6 @@ System.register([], function (exports_1, context_1) {
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var decorator, Foo;
"use strict";
var __moduleName = context_1 && context_1.id;
return {
setters: [],
@ -37,6 +37,7 @@ System.register([], function (exports_1, context_1) {
});
//// [b.js]
System.register([], function (exports_1, context_1) {
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@ -44,7 +45,6 @@ System.register([], function (exports_1, context_1) {
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var decorator, default_1;
"use strict";
var __moduleName = context_1 && context_1.id;
return {
setters: [],

View File

@ -10,8 +10,8 @@ console.log(A + B + C + D + E + F)
//// [deduplicateImportsInSystem.js]
System.register(["f1", "f2", "f3"], function (exports_1, context_1) {
var f1_1, f2_1, f3_1, f2_2, f2_3, f1_2;
"use strict";
var f1_1, f2_1, f3_1, f2_2, f2_3, f1_2;
var __moduleName = context_1 && context_1.id;
return {
setters: [

View File

@ -9,8 +9,8 @@ export default function foo() {}
//// [a.js]
System.register([], function (exports_1, context_1) {
var Foo;
"use strict";
var Foo;
var __moduleName = context_1 && context_1.id;
return {
setters: [],

View File

@ -26,8 +26,8 @@ export { nonexportedFoo };
export { exportedFoo as foo, nonexportedFoo as nfoo };
//// [destructuringAssignmentWithExportedName.js]
var _a, _b, _c, _d, _e;
"use strict";
var _a, _b, _c, _d, _e;
Object.defineProperty(exports, "__esModule", { value: true });
exports.foo = exports.exportedFoo;
let nonexportedFoo;

View File

@ -7,8 +7,8 @@ export let { toString } = 1;
//// [destructuringInVariableDeclarations7.js]
System.register([], function (exports_1, context_1) {
var toString;
"use strict";
var toString;
var __moduleName = context_1 && context_1.id;
return {
setters: [],

View File

@ -8,8 +8,8 @@ export {};
//// [destructuringInVariableDeclarations8.js]
System.register([], function (exports_1, context_1) {
var toString;
"use strict";
var toString;
var __moduleName = context_1 && context_1.id;
return {
setters: [],

View File

@ -9,8 +9,8 @@ export function bar() {
//// [dottedNamesInSystem.js]
System.register([], function (exports_1, context_1) {
var A;
"use strict";
var A;
var __moduleName = context_1 && context_1.id;
function bar() {
return A.B.C.foo();

View File

@ -15,8 +15,8 @@ export default class A
//// [es5-system.js]
System.register([], function (exports_1, context_1) {
var A;
"use strict";
var A;
var __moduleName = context_1 && context_1.id;
return {
setters: [],

View File

@ -3,8 +3,8 @@ export var __esModule = 1;
//// [es5-system2.js]
System.register([], function (exports_1, context_1) {
var __esModule;
"use strict";
var __esModule;
var __moduleName = context_1 && context_1.id;
return {
setters: [],

View File

@ -35,8 +35,8 @@ export let h1: D = new D;
//// [exportNonInitializedVariablesSystem.js]
System.register([], function (exports_1, context_1) {
var a, b, c, d, A, e, f, B, C, a1, b1, c1, d1, D, e1, f1, g1, h1;
"use strict";
var a, b, c, d, A, e, f, B, C, a1, b1, c1, d1, D, e1, f1, g1, h1;
var __moduleName = context_1 && context_1.id;
return {
setters: [],

View File

@ -13,8 +13,8 @@ var x = 1;
//// [file0.js]
System.register([], function (exports_1, context_1) {
var v;
"use strict";
var v;
var __moduleName = context_1 && context_1.id;
return {
setters: [],
@ -35,8 +35,8 @@ System.register([], function (exports_1, context_1) {
});
//// [file2.js]
System.register(["file0"], function (exports_1, context_1) {
var x;
"use strict";
var x;
var __moduleName = context_1 && context_1.id;
function exportStar_1(m) {
var exports = {};

View File

@ -19,8 +19,8 @@ System.register([], function (exports_1, context_1) {
});
//// [file2.js]
System.register([], function (exports_1, context_1) {
var x;
"use strict";
var x;
var __moduleName = context_1 && context_1.id;
return {
setters: [],

View File

@ -19,8 +19,8 @@ System.register([], function (exports_1, context_1) {
});
//// [file2.js]
System.register([], function (exports_1, context_1) {
var x;
"use strict";
var x;
var __moduleName = context_1 && context_1.id;
return {
setters: [],

View File

@ -30,6 +30,7 @@ export const l = async () => {
//// [test.js]
System.register([], function (exports_1, context_1) {
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@ -66,7 +67,6 @@ System.register([], function (exports_1, context_1) {
}
};
var _this, cl1, obj, cl2, l;
"use strict";
_this = this;
var __moduleName = context_1 && context_1.id;
function fn() {

View File

@ -30,6 +30,7 @@ export const l = async () => {
//// [test.js]
System.register([], function (exports_1, context_1) {
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@ -66,7 +67,6 @@ System.register([], function (exports_1, context_1) {
}
};
var _this, cl1, obj, cl2, l;
"use strict";
_this = this;
var __moduleName = context_1 && context_1.id;
function fn() {

View File

@ -30,6 +30,7 @@ export const l = async () => {
//// [test.js]
System.register([], function (exports_1, context_1) {
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@ -39,7 +40,6 @@ System.register([], function (exports_1, context_1) {
});
};
var cl1, obj, cl2, l;
"use strict";
var __moduleName = context_1 && context_1.id;
function fn() {
return __awaiter(this, void 0, void 0, function* () {

View File

@ -42,8 +42,8 @@ System.register([], function (exports_1, context_1) {
});
//// [1.js]
System.register([], function (exports_1, context_1) {
var p1, p2, C, D;
"use strict";
var p1, p2, C, D;
var __moduleName = context_1 && context_1.id;
function foo() {
var p2 = context_1.import("./0");

View File

@ -42,8 +42,8 @@ System.register([], function (exports_1, context_1) {
});
//// [1.js]
System.register([], function (exports_1, context_1) {
var p1, p2, C, D;
"use strict";
var p1, p2, C, D;
var __moduleName = context_1 && context_1.id;
function foo() {
const p2 = context_1.import("./0");

View File

@ -30,8 +30,8 @@ System.register([], function (exports_1, context_1) {
});
//// [1.js]
System.register([], function (exports_1, context_1) {
var p1, p2;
"use strict";
var p1, p2;
var __moduleName = context_1 && context_1.id;
function foo() {
const p2 = context_1.import("./0");

View File

@ -18,8 +18,8 @@ foo(import("./0"));
//// [0.js]
System.register([], function (exports_1, context_1) {
var B;
"use strict";
var B;
var __moduleName = context_1 && context_1.id;
return {
setters: [],

View File

@ -15,8 +15,8 @@ foo();
//// [0.js]
System.register([], function (exports_1, context_1) {
var B;
"use strict";
var B;
var __moduleName = context_1 && context_1.id;
return {
setters: [],

View File

@ -42,8 +42,8 @@ export class D {
//// [0.js]
System.register([], function (exports_1, context_1) {
var B;
"use strict";
var B;
var __moduleName = context_1 && context_1.id;
function foo() { return "foo"; }
exports_1("foo", foo);
@ -71,8 +71,8 @@ System.register([], function (exports_1, context_1) {
});
//// [2.js]
System.register([], function (exports_1, context_1) {
var C, D;
"use strict";
var C, D;
var __moduleName = context_1 && context_1.id;
return {
setters: [],

View File

@ -19,8 +19,8 @@ export declare function __awaiter(thisArg: any, _arguments: any, P: Function, ge
//// [a.js]
System.register([], function (exports_1, context_1) {
var A;
"use strict";
var A;
var __moduleName = context_1 && context_1.id;
return {
setters: [],
@ -36,8 +36,8 @@ System.register([], function (exports_1, context_1) {
});
//// [b.js]
System.register(["tslib", "./a"], function (exports_1, context_1) {
var tslib_1, a_1, B;
"use strict";
var tslib_1, a_1, B;
var __moduleName = context_1 && context_1.id;
var exportedNames_1 = {
"B": true

View File

@ -8,8 +8,8 @@ import * from Zero from "./0"
//// [0.js]
System.register([], function (exports_1, context_1) {
var C;
"use strict";
var C;
var __moduleName = context_1 && context_1.id;
return {
setters: [],
@ -25,8 +25,8 @@ System.register([], function (exports_1, context_1) {
});
//// [1.js]
System.register([], function (exports_1, context_1) {
var from;
"use strict";
var from;
var __moduleName = context_1 && context_1.id;
return {
setters: [],

View File

@ -5,8 +5,8 @@ export class Foo {}
//// [modulePrologueSystem.js]
System.register([], function (exports_1, context_1) {
var Foo;
"use strict";
var Foo;
var __moduleName = context_1 && context_1.id;
return {
setters: [],

View File

@ -12,8 +12,8 @@ export default function foo() { new Foo(); }
//// [output.js]
System.register("b", ["a"], function (exports_1, context_1) {
var a_1;
"use strict";
var a_1;
var __moduleName = context_1 && context_1.id;
function foo() { new a_1.default(); }
exports_1("default", foo);
@ -28,8 +28,8 @@ System.register("b", ["a"], function (exports_1, context_1) {
};
});
System.register("a", ["b"], function (exports_2, context_2) {
var b_1, Foo;
"use strict";
var b_1, Foo;
var __moduleName = context_2 && context_2.id;
return {
setters: [

View File

@ -19,8 +19,8 @@ var __extends = (this && this.__extends) || (function () {
};
})();
System.register("ref/a", [], function (exports_1, context_1) {
var A;
"use strict";
var A;
var __moduleName = context_1 && context_1.id;
return {
setters: [],
@ -35,8 +35,8 @@ System.register("ref/a", [], function (exports_1, context_1) {
};
});
System.register("b", ["ref/a"], function (exports_2, context_2) {
var a_1, B;
"use strict";
var a_1, B;
var __moduleName = context_2 && context_2.id;
return {
setters: [

View File

@ -19,8 +19,8 @@ sourceFile:tests/cases/compiler/ref/a.ts
>>> };
>>>})();
>>>System.register("ref/a", [], function (exports_1, context_1) {
>>> var A;
>>> "use strict";
>>> var A;
>>> var __moduleName = context_1 && context_1.id;
>>> return {
>>> setters: [],
@ -86,8 +86,8 @@ sourceFile:tests/cases/compiler/b.ts
>>> };
>>>});
>>>System.register("b", ["ref/a"], function (exports_2, context_2) {
>>> var a_1, B;
>>> "use strict";
>>> var a_1, B;
>>> var __moduleName = context_2 && context_2.id;
>>> return {
>>> setters: [

View File

@ -31,8 +31,8 @@ if (++y) {
//// [prefixUnaryOperatorsOnExportedVariables.js]
System.register([], function (exports_1, context_1) {
var x, y;
"use strict";
var x, y;
var __moduleName = context_1 && context_1.id;
return {
setters: [],

View File

@ -6,8 +6,8 @@ export default Home
//// [systemDefaultExportCommentValidity.js]
System.register([], function (exports_1, context_1) {
var Home;
"use strict";
var Home;
var __moduleName = context_1 && context_1.id;
return {
setters: [],

View File

@ -17,8 +17,8 @@ const _: string = repeat(new Date().toUTCString() + " ", 2);
//// [greeter.js]
System.register(["core-js/fn/string/repeat"], function (exports_1, context_1) {
var repeat_1, _;
"use strict";
var repeat_1, _;
var __moduleName = context_1 && context_1.id;
return {
setters: [

View File

@ -10,8 +10,8 @@ import * as a from "a";
//// [a.js]
System.register([], function (exports_1, context_1) {
var a;
"use strict";
var a;
var __moduleName = context_1 && context_1.id;
return {
setters: [],

View File

@ -5,8 +5,8 @@ for (var key in obj)
//// [systemJsForInNoException.js]
System.register([], function (exports_1, context_1) {
var obj, key;
"use strict";
var obj, key;
var __moduleName = context_1 && context_1.id;
return {
setters: [],

View File

@ -3,8 +3,8 @@ export var x = 1;
//// [systemModule1.js]
System.register([], function (exports_1, context_1) {
var x;
"use strict";
var x;
var __moduleName = context_1 && context_1.id;
return {
setters: [],

View File

@ -10,8 +10,8 @@ export {n2 as n3}
//// [systemModule10.js]
System.register(["file1", "file2"], function (exports_1, context_1) {
var file1_1, n2;
"use strict";
var file1_1, n2;
var __moduleName = context_1 && context_1.id;
return {
setters: [

View File

@ -10,8 +10,8 @@ export {n2 as n3}
//// [systemModule10_ES5.js]
System.register(["file1", "file2"], function (exports_1, context_1) {
var file1_1, n2;
"use strict";
var file1_1, n2;
var __moduleName = context_1 && context_1.id;
return {
setters: [

View File

@ -38,8 +38,8 @@ export * from 'a';
//// [file1.js]
// set of tests cases that checks generation of local storage for exported names
System.register(["bar"], function (exports_1, context_1) {
var x;
"use strict";
var x;
var __moduleName = context_1 && context_1.id;
function foo() { }
exports_1("foo", foo);
@ -66,8 +66,8 @@ System.register(["bar"], function (exports_1, context_1) {
});
//// [file2.js]
System.register(["bar"], function (exports_1, context_1) {
var x, y;
"use strict";
var x, y;
var __moduleName = context_1 && context_1.id;
var exportedNames_1 = {
"x": true,
@ -125,8 +125,8 @@ System.register(["a", "bar"], function (exports_1, context_1) {
});
//// [file4.js]
System.register(["a"], function (exports_1, context_1) {
var x, z, z1;
"use strict";
var x, z, z1;
var __moduleName = context_1 && context_1.id;
function foo() { }
exports_1("foo", foo);

View File

@ -5,8 +5,8 @@ for ([x] of [[1]]) {}
//// [systemModule13.js]
System.register([], function (exports_1, context_1) {
var _a, _b, x, y, z, z0, z1;
"use strict";
var _a, _b, x, y, z, z0, z1;
var __moduleName = context_1 && context_1.id;
return {
setters: [],

View File

@ -11,8 +11,8 @@ export {foo as b}
//// [systemModule14.js]
System.register(["foo"], function (exports_1, context_1) {
var foo_1, x;
"use strict";
var foo_1, x;
var __moduleName = context_1 && context_1.id;
function foo() {
return foo_1.a;

View File

@ -30,8 +30,8 @@ export var value2 = "v";
//// [file3.js]
System.register([], function (exports_1, context_1) {
var value;
"use strict";
var value;
var __moduleName = context_1 && context_1.id;
return {
setters: [],
@ -43,8 +43,8 @@ System.register([], function (exports_1, context_1) {
});
//// [file4.js]
System.register([], function (exports_1, context_1) {
var value2;
"use strict";
var value2;
var __moduleName = context_1 && context_1.id;
return {
setters: [],
@ -55,8 +55,8 @@ System.register([], function (exports_1, context_1) {
});
//// [file2.js]
System.register(["./file3"], function (exports_1, context_1) {
var moduleCStar, file3_1, file3_2;
"use strict";
var moduleCStar, file3_1, file3_2;
var __moduleName = context_1 && context_1.id;
return {
setters: [
@ -75,8 +75,8 @@ System.register(["./file3"], function (exports_1, context_1) {
});
//// [file1.js]
System.register(["./file2"], function (exports_1, context_1) {
var moduleB;
"use strict";
var moduleB;
var __moduleName = context_1 && context_1.id;
return {
setters: [

View File

@ -13,8 +13,8 @@ x,y,a1,b1,d1;
//// [systemModule16.js]
System.register(["foo", "bar"], function (exports_1, context_1) {
var x, y, foo_1;
"use strict";
var x, y, foo_1;
var __moduleName = context_1 && context_1.id;
var exportedNames_1 = {
"x": true,

View File

@ -40,8 +40,8 @@ export {II as II1};
//// [f1.js]
System.register([], function (exports_1, context_1) {
var A;
"use strict";
var A;
var __moduleName = context_1 && context_1.id;
return {
setters: [],
@ -57,8 +57,8 @@ System.register([], function (exports_1, context_1) {
});
//// [f2.js]
System.register(["f1"], function (exports_1, context_1) {
var x, N, IX, f1_1;
"use strict";
var x, N, IX, f1_1;
var __moduleName = context_1 && context_1.id;
return {
setters: [

View File

@ -4,8 +4,8 @@ export = x;
//// [systemModule2.js]
System.register([], function (exports_1, context_1) {
var x;
"use strict";
var x;
var __moduleName = context_1 && context_1.id;
return {
setters: [],

View File

@ -38,8 +38,8 @@ System.register([], function (exports_1, context_1) {
});
//// [file3.js]
System.register([], function (exports_1, context_1) {
var C;
"use strict";
var C;
var __moduleName = context_1 && context_1.id;
return {
setters: [],
@ -55,8 +55,8 @@ System.register([], function (exports_1, context_1) {
});
//// [file4.js]
System.register([], function (exports_1, context_1) {
var default_1;
"use strict";
var default_1;
var __moduleName = context_1 && context_1.id;
return {
setters: [],

View File

@ -4,8 +4,8 @@ export var y;
//// [systemModule4.js]
System.register([], function (exports_1, context_1) {
var x, y;
"use strict";
var x, y;
var __moduleName = context_1 && context_1.id;
return {
setters: [],

View File

@ -7,8 +7,8 @@ function foo() {
//// [systemModule6.js]
System.register([], function (exports_1, context_1) {
var C;
"use strict";
var C;
var __moduleName = context_1 && context_1.id;
function foo() {
new C();

View File

@ -11,8 +11,8 @@ export module M {
//// [systemModule7.js]
System.register([], function (exports_1, context_1) {
var M;
"use strict";
var M;
var __moduleName = context_1 && context_1.id;
return {
setters: [],

View File

@ -31,8 +31,8 @@ for ([x] of [[1]]) {}
//// [systemModule8.js]
System.register([], function (exports_1, context_1) {
var _a, x, y, z0, z1;
"use strict";
var _a, x, y, z0, z1;
var __moduleName = context_1 && context_1.id;
function foo() {
exports_1("x", x = 100);

View File

@ -22,8 +22,8 @@ export {y as z};
//// [systemModule9.js]
System.register(["file1", "file2", "file3", "file4", "file5", "file6", "file7"], function (exports_1, context_1) {
var ns, file2_1, file3_1, file5_1, ns3, x, y;
"use strict";
var ns, file2_1, file3_1, file5_1, ns3, x, y;
var __moduleName = context_1 && context_1.id;
var exportedNames_1 = {
"x": true,

View File

@ -29,8 +29,8 @@ export declare module M { var v: number; }
//// [file1.js]
System.register([], function (exports_1, context_1) {
var promise, foo, c, e;
"use strict";
var promise, foo, c, e;
var __moduleName = context_1 && context_1.id;
return {
setters: [],

View File

@ -13,8 +13,8 @@ module M {
//// [systemModuleConstEnumsSeparateCompilation.js]
System.register([], function (exports_1, context_1) {
var TopLevelConstEnum, M;
"use strict";
var TopLevelConstEnum, M;
var __moduleName = context_1 && context_1.id;
function foo() {
use(TopLevelConstEnum.X);

View File

@ -10,8 +10,8 @@ export module E { var x; }
//// [systemModuleDeclarationMerging.js]
System.register([], function (exports_1, context_1) {
var C, E;
"use strict";
var C, E;
var __moduleName = context_1 && context_1.id;
function F() { }
exports_1("F", F);

View File

@ -40,8 +40,8 @@ System.register([], function (exports_1, context_1) {
});
//// [file3.js]
System.register([], function (exports_1, context_1) {
var default_1;
"use strict";
var default_1;
var __moduleName = context_1 && context_1.id;
return {
setters: [],
@ -57,8 +57,8 @@ System.register([], function (exports_1, context_1) {
});
//// [file4.js]
System.register([], function (exports_1, context_1) {
var C;
"use strict";
var C;
var __moduleName = context_1 && context_1.id;
return {
setters: [],

View File

@ -13,8 +13,8 @@ export module TopLevelModule2 {
//// [systemModuleNonTopLevelModuleMembers.js]
System.register([], function (exports_1, context_1) {
var TopLevelClass, TopLevelModule, TopLevelEnum, TopLevelModule2;
"use strict";
var TopLevelClass, TopLevelModule, TopLevelEnum, TopLevelModule2;
var __moduleName = context_1 && context_1.id;
function TopLevelFunction() { }
exports_1("TopLevelFunction", TopLevelFunction);

View File

@ -15,8 +15,8 @@ export function myFunction2() {
//// [systemModuleTargetES6.js]
System.register([], function (exports_1, context_1) {
var MyClass, MyClass2;
"use strict";
var MyClass, MyClass2;
var __moduleName = context_1 && context_1.id;
function myFunction() {
return new MyClass();

View File

@ -5,8 +5,8 @@ export const test = "TEST";
//// [systemModuleTrailingComments.js]
System.register([], function (exports_1, context_1) {
var test;
"use strict";
var test;
var __moduleName = context_1 && context_1.id;
return {
setters: [],

View File

@ -13,8 +13,8 @@ export class Bar extends Foo {
//// [foo.js]
System.register([], function (exports_1, context_1) {
var Foo;
"use strict";
var Foo;
var __moduleName = context_1 && context_1.id;
return {
setters: [],
@ -30,6 +30,7 @@ System.register([], function (exports_1, context_1) {
});
//// [bar.js]
System.register(["./foo"], function (exports_1, context_1) {
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@ -41,7 +42,6 @@ System.register(["./foo"], function (exports_1, context_1) {
};
})();
var foo_1, Bar;
"use strict";
var __moduleName = context_1 && context_1.id;
return {
setters: [

View File

@ -12,8 +12,8 @@ export {ns, AnEnum, ns as FooBar, AnEnum as BarEnum};
//// [systemNamespaceAliasEmit.js]
System.register([], function (exports_1, context_1) {
var ns, AnEnum;
"use strict";
var ns, AnEnum;
var __moduleName = context_1 && context_1.id;
return {
setters: [],

View File

@ -13,8 +13,8 @@ const b = {x3}
//// [x.js]
System.register([], function (exports_1, context_1) {
var x;
"use strict";
var x;
var __moduleName = context_1 && context_1.id;
return {
setters: [],
@ -25,8 +25,8 @@ System.register([], function (exports_1, context_1) {
});
//// [index.js]
System.register(["./x.js"], function (exports_1, context_1) {
var x_js_1, x2, a, x3, b;
"use strict";
var x_js_1, x2, a, x3, b;
var __moduleName = context_1 && context_1.id;
return {
setters: [

View File

@ -1,4 +1,5 @@
System.register(["angular2/core"], function (exports_1, context_1) {
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@ -9,7 +10,6 @@ System.register(["angular2/core"], function (exports_1, context_1) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var ng, MyClass1;
"use strict";
var __moduleName = context_1 && context_1.id;
return {
setters: [

View File

@ -1,4 +1,5 @@
System.register(["angular2/core"], function (exports_1, context_1) {
"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@ -9,7 +10,6 @@ System.register(["angular2/core"], function (exports_1, context_1) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var ng, MyClass1;
"use strict";
var __moduleName = context_1 && context_1.id;
return {
setters: [

View File

@ -1,6 +1,6 @@
System.register(["SomeOtherName"], function (exports_1, context_1) {
var SomeName_1;
"use strict";
var SomeName_1;
var __moduleName = context_1 && context_1.id;
return {
setters: [