MCPcopy Create free account
hub / github.com/babel/babel / parse

Function parse

scripts/parser-tests/flow/index.js:118–138  ·  view source on GitHub ↗
(test, parser)

Source from the content-addressed store, hash-verified

116 },
117
118 parse(test, parser) {
119 try {
120 parser(test.contents, {
121 sourceType: "module",
122 ...test.options,
123 });
124 } catch (e) {
125 // let's retry in script mode
126 if (!test.expectedError) {
127 try {
128 parser(test.contents, {
129 sourceType: "script",
130 ...test.options,
131 });
132 return;
133 } catch {}
134 }
135
136 throw e;
137 }
138 },
139});
140
141runner.run().catch(err => {

Callers

nothing calls this directly

Calls 1

parserFunction · 0.50

Tested by

no test coverage detected