MCPcopy Create free account
hub / github.com/nodejs/node / isValid

Function isValid

deps/v8/tools/clusterfuzz/js_fuzzer/db.js:258–276  ·  view source on GitHub ↗

* Returns true if an expression can be applied or false otherwise.

(expression)

Source from the content-addressed store, hash-verified

256 * Returns true if an expression can be applied or false otherwise.
257 */
258function isValid(expression) {
259 const expressionTemplate = babelTemplate(
260 expression.source,
261 sourceHelpers.BABYLON_REPLACE_VAR_OPTIONS);
262
263 const dependencies = {};
264 if (expression.dependencies) {
265 for (const dependency of expression.dependencies) {
266 dependencies[dependency] = babelTypes.identifier('__v_0');
267 }
268 }
269
270 try {
271 expressionTemplate(dependencies);
272 } catch (e) {
273 return false;
274 }
275 return true;
276}
277
278function writeIndexFile(path, index) {
279 index.sort((a, b) => a.path.localeCompare(b.path));

Callers 1

ExpressionMethod · 0.85

Calls 1

identifierMethod · 0.45

Tested by

no test coverage detected