GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test(javascript): parse again inside a path tap · webpack/webpack@cbfb6a2

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • test/configCases/parsing/hook-path-taps
    • webpack.config.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎test/configCases/parsing/hook-path-taps/webpack.config.js‎

Copy file name to clipboardExpand all lines: test/configCases/parsing/hook-path-taps/webpack.config.js
+8Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,13 @@ const hookPathTaps = (compiler) => {
4343
seen.add("call object");
4444
});
4545
parser.hooks.call.for("magicCall").tap(opts, (path, call) => {
46+
expect(path.type(call)).toBe(NodeType.CallExpression);
47+
// a parse inside the tap has a view of its own, and this one's
48+
// ids read the same after it
49+
if (!seen.has("nested parse")) {
50+
seen.add("nested parse");
51+
parser.parse("1;", parser.state);
52+
}
4653
expect(path.type(call)).toBe(NodeType.CallExpression);
4754
const argument = path.field(0, Field.arguments, call);
4855
expect(path.value(argument)).toBe("hello");
@@ -106,6 +113,7 @@ const hookPathTaps = (compiler) => {
106113
"importCall",
107114
"importCall without then",
108115
"importSpecifier",
116+
"nested parse",
109117
"statement"
110118
]);
111119
// called outside a parse, a path tap reads through a view of its own

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.