MCPcopy
hub / github.com/webpack/webpack / getTest262Meta

Function getTest262Meta

test/test262.spectest.js:569–590  ·  view source on GitHub ↗
(content)

Source from the content-addressed store, hash-verified

567};
568
569const getTest262Meta = (content) => {
570 const metaMatch = content.match(/\/\*---([\s\S]*?)---\*\//);
571 if (!metaMatch) {
572 return { flags: [], features: [], includes: [], negative: null };
573 }
574
575 const meta = metaMatch[1];
576
577 const features = extractYamlArray(meta, "features");
578 const flags = extractYamlArray(meta, "flags");
579
580 const includes = extractYamlArray(meta, "includes");
581
582 const negativeMatch = meta.match(
583 /negative:[\s\S]*?phase:\s*(\w+)[\s\S]*?type:\s*(\w+)/
584 );
585 const negative = negativeMatch
586 ? { phase: negativeMatch[1], type: negativeMatch[2] }
587 : null;
588
589 return { features, flags, includes, negative };
590};
591
592const createRequire = (currentDir, context) =>
593 function require(modulePath) {

Callers 1

Calls 1

extractYamlArrayFunction · 0.85

Tested by

no test coverage detected