From 29a2060ffb23dec075f1358a39fc99a3e6c02df5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 28 Nov 2025 21:25:07 +0000 Subject: [PATCH 1/2] deps(deps): bump microsoft/typescript-go from `d1be94b` to `ea6a3dc` Bumps [microsoft/typescript-go](https://github.com/microsoft/typescript-go) from `d1be94b` to `ea6a3dc`. - [Commits](https://github.com/microsoft/typescript-go/compare/d1be94b3c21175dac7b631f952a737a2995d59da...ea6a3dc055cfcac80fecf12264b01d62bfd7a094) --- updated-dependencies: - dependency-name: microsoft/typescript-go dependency-version: ea6a3dc055cfcac80fecf12264b01d62bfd7a094 dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- microsoft/typescript-go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/microsoft/typescript-go b/microsoft/typescript-go index d1be94b3..ea6a3dc0 160000 --- a/microsoft/typescript-go +++ b/microsoft/typescript-go @@ -1 +1 @@ -Subproject commit d1be94b3c21175dac7b631f952a737a2995d59da +Subproject commit ea6a3dc055cfcac80fecf12264b01d62bfd7a094 From 63a4656aa4167a0559860aa2c635013d04eff40e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 29 Nov 2025 15:27:40 +0800 Subject: [PATCH 2/2] chore(sync): mirror internal packages into pkg/ (auto) (#33) Co-authored-by: buke <1013738+buke@users.noreply.github.com> --- pkg/printer/printer.go | 7 ++++--- .../compiler/commentsBeforeFunctionExpression1.js | 2 +- .../commentsBeforeFunctionExpression1.js.diff | 9 --------- .../submodule/compiler/commentsInterface.js | 2 +- .../submodule/compiler/commentsInterface.js.diff | 11 ----------- .../compiler/commentsOnPropertyOfObjectLiteral1.js | 4 ++-- .../commentsOnPropertyOfObjectLiteral1.js.diff | 13 ------------- ...ds-js-based-projects-and-emits-them-correctly.js | 2 +- 8 files changed, 9 insertions(+), 41 deletions(-) delete mode 100644 testdata/baselines/reference/submodule/compiler/commentsBeforeFunctionExpression1.js.diff delete mode 100644 testdata/baselines/reference/submodule/compiler/commentsInterface.js.diff delete mode 100644 testdata/baselines/reference/submodule/compiler/commentsOnPropertyOfObjectLiteral1.js.diff diff --git a/pkg/printer/printer.go b/pkg/printer/printer.go index ecd386cf..75c11981 100644 --- a/pkg/printer/printer.go +++ b/pkg/printer/printer.go @@ -4272,9 +4272,10 @@ func (p *Printer) emitPropertyAssignment(node *ast.PropertyAssignment) { // "comment1" is not considered to be leading comment for node.initializer // but rather a trailing comment on the previous node. initializer := node.Initializer - - // !!! emit trailing comments of initializer - + if p.emitContext.EmitFlags(initializer)&EFNoLeadingComments == 0 { + commentRange := getCommentRange(initializer) + p.emitTrailingComments(commentRange.Pos(), commentSeparatorAfter) + } p.emitExpression(initializer, ast.OperatorPrecedenceDisallowComma) p.exitNode(node.AsNode(), state) } diff --git a/testdata/baselines/reference/submodule/compiler/commentsBeforeFunctionExpression1.js b/testdata/baselines/reference/submodule/compiler/commentsBeforeFunctionExpression1.js index 7af390fb..ead9db1f 100644 --- a/testdata/baselines/reference/submodule/compiler/commentsBeforeFunctionExpression1.js +++ b/testdata/baselines/reference/submodule/compiler/commentsBeforeFunctionExpression1.js @@ -8,5 +8,5 @@ var v = { //// [commentsBeforeFunctionExpression1.js] var v = { - f: (a) => 0 + f: /**own f*/ (a) => 0 }; diff --git a/testdata/baselines/reference/submodule/compiler/commentsBeforeFunctionExpression1.js.diff b/testdata/baselines/reference/submodule/compiler/commentsBeforeFunctionExpression1.js.diff deleted file mode 100644 index c8222c9e..00000000 --- a/testdata/baselines/reference/submodule/compiler/commentsBeforeFunctionExpression1.js.diff +++ /dev/null @@ -1,9 +0,0 @@ ---- old.commentsBeforeFunctionExpression1.js -+++ new.commentsBeforeFunctionExpression1.js -@@= skipped -7, +7 lines =@@ - - //// [commentsBeforeFunctionExpression1.js] - var v = { -- f: /**own f*/ (a) => 0 -+ f: (a) => 0 - }; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/commentsInterface.js b/testdata/baselines/reference/submodule/compiler/commentsInterface.js index ee3059a0..b9c26537 100644 --- a/testdata/baselines/reference/submodule/compiler/commentsInterface.js +++ b/testdata/baselines/reference/submodule/compiler/commentsInterface.js @@ -91,7 +91,7 @@ var i2_i_nc_fnfoo = i2_i.nc_fnfoo; var i2_i_nc_fnfoo_r = i2_i.nc_fnfoo(10); var i3_i; i3_i = { - f: (/**i3_i a*/ a) => "Hello" + a, + f: /**own f*/ (/**i3_i a*/ a) => "Hello" + a, l: this.f, /** own x*/ x: this.f(10), diff --git a/testdata/baselines/reference/submodule/compiler/commentsInterface.js.diff b/testdata/baselines/reference/submodule/compiler/commentsInterface.js.diff deleted file mode 100644 index 0b90da52..00000000 --- a/testdata/baselines/reference/submodule/compiler/commentsInterface.js.diff +++ /dev/null @@ -1,11 +0,0 @@ ---- old.commentsInterface.js -+++ new.commentsInterface.js -@@= skipped -90, +90 lines =@@ - var i2_i_nc_fnfoo_r = i2_i.nc_fnfoo(10); - var i3_i; - i3_i = { -- f: /**own f*/ (/**i3_i a*/ a) => "Hello" + a, -+ f: (/**i3_i a*/ a) => "Hello" + a, - l: this.f, - /** own x*/ - x: this.f(10), \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/commentsOnPropertyOfObjectLiteral1.js b/testdata/baselines/reference/submodule/compiler/commentsOnPropertyOfObjectLiteral1.js index 53eaf982..9a7518f8 100644 --- a/testdata/baselines/reference/submodule/compiler/commentsOnPropertyOfObjectLiteral1.js +++ b/testdata/baselines/reference/submodule/compiler/commentsOnPropertyOfObjectLiteral1.js @@ -17,8 +17,8 @@ var resolve = { //// [commentsOnPropertyOfObjectLiteral1.js] var resolve = { - id: (details) => details.id, - id1: "hello", + id: /*! @ngInject */ (details) => details.id, + id1: /* c1 */ "hello", id2: /*! @ngInject */ (details) => details.id, id3: diff --git a/testdata/baselines/reference/submodule/compiler/commentsOnPropertyOfObjectLiteral1.js.diff b/testdata/baselines/reference/submodule/compiler/commentsOnPropertyOfObjectLiteral1.js.diff deleted file mode 100644 index 90ad646a..00000000 --- a/testdata/baselines/reference/submodule/compiler/commentsOnPropertyOfObjectLiteral1.js.diff +++ /dev/null @@ -1,13 +0,0 @@ ---- old.commentsOnPropertyOfObjectLiteral1.js -+++ new.commentsOnPropertyOfObjectLiteral1.js -@@= skipped -16, +16 lines =@@ - - //// [commentsOnPropertyOfObjectLiteral1.js] - var resolve = { -- id: /*! @ngInject */ (details) => details.id, -- id1: /* c1 */ "hello", -+ id: (details) => details.id, -+ id1: "hello", - id2: - /*! @ngInject */ (details) => details.id, - id3: \ No newline at end of file diff --git a/testdata/baselines/reference/tsbuild/javascriptProjectEmit/loads-js-based-projects-and-emits-them-correctly.js b/testdata/baselines/reference/tsbuild/javascriptProjectEmit/loads-js-based-projects-and-emits-them-correctly.js index 83977174..89ed6551 100644 --- a/testdata/baselines/reference/tsbuild/javascriptProjectEmit/loads-js-based-projects-and-emits-them-correctly.js +++ b/testdata/baselines/reference/tsbuild/javascriptProjectEmit/loads-js-based-projects-and-emits-them-correctly.js @@ -207,7 +207,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.getVar = getVar; const index_1 = require("../sub-project/index"); const variable = { - key: 'value', + key: /** @type {MyNominal} */ 'value', }; /** * @return {keyof typeof variable}