Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: don't pass default parserOptions to custom parsers (fixes #8744)
afbea78 accidentally introduced a regression where parsers would get passed additional "default" options even when the user did not specify them. This updates the default parserOptions to prevent any unexpected options from getting passed to parsers.
- Loading branch information
1 parent
5f81a68
commit 720d015
Showing
4 changed files
with
20 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
"use strict"; | ||
|
||
const espree = require("espree"); | ||
|
||
exports.parse = (sourceText, options) => { | ||
if (options.ecmaVersion) { | ||
throw new Error("Expected no parserOptions to be used"); | ||
} | ||
return espree.parse(sourceText, options); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters