Skip to content

Commit 344a9d2

Browse files
committed
PR feedback
1 parent dedf4a7 commit 344a9d2

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/compiler/checker.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17738,7 +17738,7 @@ namespace ts {
1773817738
}
1773917739

1774017740
if (node.kind === SyntaxKind.BindingElement) {
17741-
if (node.parent.kind === SyntaxKind.ObjectBindingPattern && languageVersion < ScriptTarget.ESNext && !isInAmbientContext(node)) {
17741+
if (node.parent.kind === SyntaxKind.ObjectBindingPattern && languageVersion < ScriptTarget.ESNext) {
1774217742
checkExternalEmitHelpers(node, ExternalEmitHelpers.Rest);
1774317743
}
1774417744
// check computed properties inside property names of binding elements
@@ -18758,7 +18758,7 @@ namespace ts {
1875818758

1875918759
const baseTypeNode = getClassExtendsHeritageClauseElement(node);
1876018760
if (baseTypeNode) {
18761-
if (languageVersion < ScriptTarget.ES2015 && !isInAmbientContext(node)) {
18761+
if (languageVersion < ScriptTarget.ES2015) {
1876218762
checkExternalEmitHelpers(baseTypeNode.parent, ExternalEmitHelpers.Extends);
1876318763
}
1876418764

@@ -21287,7 +21287,7 @@ namespace ts {
2128721287
function checkExternalEmitHelpers(location: Node, helpers: ExternalEmitHelpers) {
2128821288
if ((requestedExternalEmitHelpers & helpers) !== helpers && compilerOptions.importHelpers) {
2128921289
const sourceFile = getSourceFileOfNode(location);
21290-
if (!isDeclarationFile(sourceFile) && isEffectiveExternalModule(sourceFile, compilerOptions)) {
21290+
if (isEffectiveExternalModule(sourceFile, compilerOptions) && !isInAmbientContext(location)) {
2129121291
const helpersModule = resolveHelpersModule(sourceFile, location);
2129221292
if (helpersModule !== unknownSymbol) {
2129321293
const uncheckedHelpers = helpers & ~requestedExternalEmitHelpers;

src/compiler/comments.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ namespace ts {
272272

273273
function forEachLeadingCommentToEmit(pos: number, cb: (commentPos: number, commentEnd: number, kind: SyntaxKind, hasTrailingNewLine: boolean, rangePos: number) => void) {
274274
// Emit the leading comments only if the container's pos doesn't match because the container should take care of emitting these comments
275-
if ((containerPos === -1 || pos !== containerPos)) {
275+
if (containerPos === -1 || pos !== containerPos) {
276276
if (hasDetachedComments(pos)) {
277277
forEachLeadingCommentWithoutDetachedComments(cb);
278278
}
@@ -284,7 +284,7 @@ namespace ts {
284284

285285
function forEachTrailingCommentToEmit(end: number, cb: (commentPos: number, commentEnd: number, kind: SyntaxKind, hasTrailingNewLine: boolean) => void) {
286286
// Emit the trailing comments only if the container's end doesn't match because the container should take care of emitting these comments
287-
if ((containerEnd === -1 || (end !== containerEnd && end !== declarationListContainerEnd))) {
287+
if (containerEnd === -1 || (end !== containerEnd && end !== declarationListContainerEnd)) {
288288
forEachTrailingCommentRange(currentText, end, cb);
289289
}
290290
}

0 commit comments

Comments
 (0)