MCPcopy
hub / github.com/webpack/webpack / wrap

Function wrap

test/parseJson.unittest.js:110–111  ·  view source on GitHub ↗
(/** @type {string} */ message, /** @type {string} */ txt)

Source from the content-addressed store, hash-verified

108 // Feed V8-shaped messages directly so the engine-specific text is fixed and the
109 // transformation is checked the same way on V8 and JSC.
110 const wrap = (/** @type {string} */ message, /** @type {string} */ txt) =>
111 new JSONParseError(new SyntaxError(message), txt, txt);
112
113 it("rewrites an unexpected token to include its char code", () => {
114 const err = wrap("Unexpected token 'o', \"foo\" is not valid JSON", "foo");

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected