@marko/compiler 5.39.30 → 5.39.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -134,9 +134,17 @@ sourceOffset)
134
134
  parserOpts.startColumn = startColumn;
135
135
 
136
136
  try {
137
- return isExpression ?
138
- babelParser.parseExpression(code, parserOpts) :
139
- babelParser.parse(code, parserOpts).program.body;
137
+ if (isExpression) {
138
+ return babelParser.parseExpression(code, parserOpts);
139
+ } else {
140
+ const { program } = babelParser.parse(code, parserOpts);
141
+ if (program.innerComments) {
142
+ const lastNode = _compiler.types.emptyStatement();
143
+ lastNode.trailingComments = program.innerComments;
144
+ program.body.push(lastNode);
145
+ }
146
+ return program.body;
147
+ }
140
148
  } catch (err) {
141
149
  const parseError = createParseError(
142
150
  file,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marko/compiler",
3
- "version": "5.39.30",
3
+ "version": "5.39.31",
4
4
  "description": "Marko template to JS compiler.",
5
5
  "keywords": [
6
6
  "babel",