Skip to content

Commit 8238894

Browse files
committed
Babel nodes are now frozen, lol, 😢
1 parent 7519a5a commit 8238894

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

test/fixture/simple.output.github.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@
8585
}
8686
},
8787
"code": "/**\n * This function returns the number one.\n * @returns {Number} numberone\n */\nmodule.exports = function () {\n // this returns 1\n return 1;\n};\n",
88-
"path": "test/fixture/simple.input.js",
89-
"github": "[github]"
88+
"github": "[github]",
89+
"path": "test/fixture/simple.input.js"
9090
},
9191
"errors": [],
9292
"returns": [

test/normalize.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,17 @@ module.exports = function (comments) {
66
if (comment.context.ast) {
77
traverse.removeProperties(comment.context.ast);
88
}
9-
delete comment.context.ast;
10-
delete comment.context.file;
11-
if (comment.context.github) {
9+
var hasGithub = !!comment.context.github;
10+
var path = comment.context.path;
11+
comment.context = {
12+
loc: comment.context.loc,
13+
code: comment.context.code
14+
};
15+
if (hasGithub) {
1216
comment.context.github = '[github]';
1317
}
18+
if (path) {
19+
comment.context.path = path;
20+
}
1421
});
1522
};

0 commit comments

Comments
 (0)