Skip to content

Commit

Permalink
Declare dependencies between helpers in the declaritive fashion intro…
Browse files Browse the repository at this point in the history
…duced by #35967 (#37001)
  • Loading branch information
weswigham committed Feb 25, 2020
1 parent e120762 commit e54b796
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/compiler/factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ namespace ts {
name: "typescript:spread",
importName: "__spread",
scoped: false,
dependencies: [readHelper],
text: `
var __spread = (this && this.__spread) || function () {
for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));
Expand All @@ -286,7 +287,6 @@ namespace ts {
};

export function createSpreadHelper(context: TransformationContext, argumentList: readonly Expression[], location?: TextRange) {
context.requestEmitHelper(readHelper);
context.requestEmitHelper(spreadHelper);
return setTextRange(
createCall(
Expand Down
4 changes: 2 additions & 2 deletions src/compiler/transformers/es2018.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1096,6 +1096,7 @@ namespace ts {
name: "typescript:asyncGenerator",
importName: "__asyncGenerator",
scoped: false,
dependencies: [awaitHelper],
text: `
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
Expand All @@ -1111,7 +1112,6 @@ namespace ts {
};

function createAsyncGeneratorHelper(context: TransformationContext, generatorFunc: FunctionExpression, hasLexicalThis: boolean) {
context.requestEmitHelper(awaitHelper);
context.requestEmitHelper(asyncGeneratorHelper);

// Mark this node as originally an async function
Expand All @@ -1132,6 +1132,7 @@ namespace ts {
name: "typescript:asyncDelegator",
importName: "__asyncDelegator",
scoped: false,
dependencies: [awaitHelper],
text: `
var __asyncDelegator = (this && this.__asyncDelegator) || function (o) {
var i, p;
Expand All @@ -1141,7 +1142,6 @@ namespace ts {
};

function createAsyncDelegatorHelper(context: TransformationContext, expression: Expression, location?: TextRange) {
context.requestEmitHelper(awaitHelper);
context.requestEmitHelper(asyncDelegator);
return setTextRange(
createCall(
Expand Down

0 comments on commit e54b796

Please sign in to comment.