Skip to content

Commit

Permalink
On second thought, removed the {}s
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaKGoldberg committed Mar 14, 2020
1 parent 94f3ca1 commit 26c7615
Show file tree
Hide file tree
Showing 813 changed files with 1,512 additions and 2,334 deletions.
125 changes: 62 additions & 63 deletions src/compiler/transformers/es2015.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ namespace ts {
}

const enum Jump {
Break = 1 << 1,
Continue = 1 << 2,
Return = 1 << 3
Break = 1 << 1,
Continue = 1 << 2,
Return = 1 << 3
}

interface ConvertedLoopState {
Expand Down Expand Up @@ -1597,7 +1597,7 @@ namespace ts {
if (!isPrivateIdentifier(propertyName) && context.getCompilerOptions().useDefineForClassFields) {
const name = isComputedPropertyName(propertyName) ? propertyName.expression
: isIdentifier(propertyName) ? createStringLiteral(unescapeLeadingUnderscores(propertyName.escapedText))
: propertyName;
: propertyName;
e = createObjectDefinePropertyCall(receiver, name, createPropertyDescriptor({ value: memberFunction, enumerable: false, writable: true, configurable: true }));
}
else {
Expand Down Expand Up @@ -2418,28 +2418,28 @@ namespace ts {
const forStatement = setTextRange(
createFor(
/*initializer*/ setEmitFlags(
setTextRange(
createVariableDeclarationList([
setTextRange(createVariableDeclaration(counter, /*type*/ undefined, createLiteral(0)), moveRangePos(node.expression, -1)),
setTextRange(createVariableDeclaration(rhsReference, /*type*/ undefined, expression), node.expression)
]),
node.expression
),
EmitFlags.NoHoisting
setTextRange(
createVariableDeclarationList([
setTextRange(createVariableDeclaration(counter, /*type*/ undefined, createLiteral(0)), moveRangePos(node.expression, -1)),
setTextRange(createVariableDeclaration(rhsReference, /*type*/ undefined, expression), node.expression)
]),
node.expression
),
EmitFlags.NoHoisting
),
/*condition*/ setTextRange(
createLessThan(
counter,
createPropertyAccess(rhsReference, "length")
),
node.expression
createLessThan(
counter,
createPropertyAccess(rhsReference, "length")
),
node.expression
),
/*incrementor*/ setTextRange(createPostfixIncrement(counter), node.expression),
/*statement*/ convertForOfStatementHead(
node,
createElementAccess(rhsReference, counter),
convertedLoopBodyStatements
)
node,
createElementAccess(rhsReference, counter),
convertedLoopBodyStatements
)
),
/*location*/ node
);
Expand Down Expand Up @@ -2472,22 +2472,22 @@ namespace ts {
setTextRange(
createFor(
/*initializer*/ setEmitFlags(
setTextRange(
createVariableDeclarationList([
setTextRange(createVariableDeclaration(iterator, /*type*/ undefined, initializer), node.expression),
createVariableDeclaration(result, /*type*/ undefined, next)
]),
node.expression
),
EmitFlags.NoHoisting
setTextRange(
createVariableDeclarationList([
setTextRange(createVariableDeclaration(iterator, /*type*/ undefined, initializer), node.expression),
createVariableDeclaration(result, /*type*/ undefined, next)
]),
node.expression
),
EmitFlags.NoHoisting
),
/*condition*/ createLogicalNot(createPropertyAccess(result, "done")),
/*incrementor*/ createAssignment(result, next),
/*statement*/ convertForOfStatementHead(
node,
createPropertyAccess(result, "value"),
convertedLoopBodyStatements
)
node,
createPropertyAccess(result, "value"),
convertedLoopBodyStatements
)
),
/*location*/ node
),
Expand Down Expand Up @@ -2520,42 +2520,42 @@ namespace ts {
createBlock([
createTry(
/*tryBlock*/ createBlock([
setEmitFlags(
createIf(
setEmitFlags(
createIf(
createLogicalAnd(
createLogicalAnd(
createLogicalAnd(
result,
createLogicalNot(
createPropertyAccess(result, "done")
)
),
createAssignment(
returnMethod,
createPropertyAccess(iterator, "return")
result,
createLogicalNot(
createPropertyAccess(result, "done")
)
),
createExpressionStatement(
createFunctionCall(returnMethod, iterator, [])
createAssignment(
returnMethod,
createPropertyAccess(iterator, "return")
)
),
EmitFlags.SingleLine
createExpressionStatement(
createFunctionCall(returnMethod, iterator, [])
)
),
]),
EmitFlags.SingleLine
),
]),
/*catchClause*/ undefined,
/*finallyBlock*/ setEmitFlags(
createBlock([
setEmitFlags(
createIf(
errorRecord,
createThrow(
createPropertyAccess(errorRecord, "error")
)
),
EmitFlags.SingleLine
)
]),
EmitFlags.SingleLine
)
createBlock([
setEmitFlags(
createIf(
errorRecord,
createThrow(
createPropertyAccess(errorRecord, "error")
)
),
EmitFlags.SingleLine
)
]),
EmitFlags.SingleLine
)
)
])
);
Expand Down Expand Up @@ -4321,9 +4321,8 @@ namespace ts {
};
return function (d, b) {
if (typeof b !== "function" && b !== null) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + b + " is not a constructor or null");
}
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,8 @@ var __extends = (this && this.__extends) || (function () {
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + b + " is not a constructor or null");
}
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,8 @@ var __extends = (this && this.__extends) || (function () {
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + b + " is not a constructor or null");
}
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
Expand Down
3 changes: 1 addition & 2 deletions tests/baselines/reference/abstractClassInLocalScope.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@ var __extends = (this && this.__extends) || (function () {
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + b + " is not a constructor or null");
}
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@ var __extends = (this && this.__extends) || (function () {
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + b + " is not a constructor or null");
}
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
Expand Down
3 changes: 1 addition & 2 deletions tests/baselines/reference/abstractProperty.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,8 @@ var __extends = (this && this.__extends) || (function () {
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + b + " is not a constructor or null");
}
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
Expand Down
3 changes: 1 addition & 2 deletions tests/baselines/reference/abstractPropertyInConstructor.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,8 @@ var __extends = (this && this.__extends) || (function () {
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + b + " is not a constructor or null");
}
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
Expand Down
3 changes: 1 addition & 2 deletions tests/baselines/reference/abstractPropertyNegative.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,8 @@ var __extends = (this && this.__extends) || (function () {
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + b + " is not a constructor or null");
}
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@ var __extends = (this && this.__extends) || (function () {
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + b + " is not a constructor or null");
}
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
Expand Down
3 changes: 1 addition & 2 deletions tests/baselines/reference/accessorsOverrideProperty7.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@ var __extends = (this && this.__extends) || (function () {
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + b + " is not a constructor or null");
}
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,8 @@ var __extends = (this && this.__extends) || (function () {
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + b + " is not a constructor or null");
}
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
Expand Down
3 changes: 1 addition & 2 deletions tests/baselines/reference/aliasUsageInAccessorsOfClass.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,8 @@ var __extends = (this && this.__extends) || (function () {
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + b + " is not a constructor or null");
}
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
Expand Down
3 changes: 1 addition & 2 deletions tests/baselines/reference/aliasUsageInArray.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,8 @@ var __extends = (this && this.__extends) || (function () {
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + b + " is not a constructor or null");
}
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
Expand Down
3 changes: 1 addition & 2 deletions tests/baselines/reference/aliasUsageInFunctionExpression.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,8 @@ var __extends = (this && this.__extends) || (function () {
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + b + " is not a constructor or null");
}
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
Expand Down
3 changes: 1 addition & 2 deletions tests/baselines/reference/aliasUsageInGenericFunction.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,8 @@ var __extends = (this && this.__extends) || (function () {
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + b + " is not a constructor or null");
}
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
Expand Down
3 changes: 1 addition & 2 deletions tests/baselines/reference/aliasUsageInIndexerOfClass.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,8 @@ var __extends = (this && this.__extends) || (function () {
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + b + " is not a constructor or null");
}
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
Expand Down
3 changes: 1 addition & 2 deletions tests/baselines/reference/aliasUsageInObjectLiteral.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,8 @@ var __extends = (this && this.__extends) || (function () {
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + b + " is not a constructor or null");
}
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
Expand Down
3 changes: 1 addition & 2 deletions tests/baselines/reference/aliasUsageInOrExpression.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,8 @@ var __extends = (this && this.__extends) || (function () {
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + b + " is not a constructor or null");
}
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,8 @@ var __extends = (this && this.__extends) || (function () {
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + b + " is not a constructor or null");
}
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
Expand All @@ -73,9 +72,8 @@ var __extends = (this && this.__extends) || (function () {
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + b + " is not a constructor or null");
}
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
Expand Down
Loading

0 comments on commit 26c7615

Please sign in to comment.