Add attachComment parser option to disable comment attachment (#13229)
This commit is contained in:
12
packages/babel-parser/test/attachComment-false.js
Normal file
12
packages/babel-parser/test/attachComment-false.js
Normal file
@@ -0,0 +1,12 @@
|
||||
import path from "path";
|
||||
import { runFixtureTestsWithoutExactASTMatch } from "./helpers/runFixtureTests";
|
||||
import { parseExpression } from "../lib";
|
||||
import { fileURLToPath } from "url";
|
||||
|
||||
runFixtureTestsWithoutExactASTMatch(
|
||||
path.join(path.dirname(fileURLToPath(import.meta.url)), "expressions"),
|
||||
(input, options = {}) => {
|
||||
options.attachComment = false;
|
||||
return parseExpression(input, options);
|
||||
},
|
||||
);
|
||||
Reference in New Issue
Block a user