MCPcopy Index your code
hub / github.com/nodejs/node / checkInvalidCachedData

Function checkInvalidCachedData

test/parallel/test-vm-module-errors.js:223–237  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

221}
222
223function checkInvalidCachedData() {
224 [true, false, 'foo', {}, Array, function() {}].forEach((invalidArg) => {
225 const message = 'The "options.cachedData" property must be an ' +
226 'instance of Buffer, TypedArray, or DataView.' +
227 common.invalidArgTypeHelper(invalidArg);
228 assert.throws(
229 () => new SourceTextModule('import "foo";', { cachedData: invalidArg }),
230 {
231 code: 'ERR_INVALID_ARG_TYPE',
232 name: 'TypeError',
233 message,
234 }
235 );
236 });
237}
238
239function checkGettersErrors() {
240 const expectedError = { name: 'TypeError' };

Callers 1

Calls 1

forEachMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…