MCPcopy Index your code
hub / github.com/processing/p5.js / MemberExpression

Function MemberExpression

src/strands/strands_transpiler.js:477–505  ·  view source on GitHub ↗
(node, state, ancestors)

Source from the content-addressed store, hash-verified

475 node.type = 'CallExpression';
476 },
477 MemberExpression(node, state, ancestors) {
478 if (ancestors.some(a => nodeIsUniform(a) || nodeIsUniformCallbackFn(a, state.uniformCallbackNames))) {
479 return;
480 }
481 // Skip sets -- these will be converted to .set() method
482 // calls at the AssignmentExpression level
483 if (
484 ancestors.at(-2)?.type === 'AssignmentExpression' &&
485 ancestors.at(-2).left === node
486 ) {
487 return;
488 }
489 if (node.computed) {
490 const callee = node.object;
491 const member = node.property;
492 node.computed = undefined;
493 node.object = undefined;
494 node.callee = {
495 type: 'MemberExpression',
496 object: callee,
497 property: {
498 type: 'Identifier',
499 name: 'get',
500 }
501 };
502 node.arguments = [member];
503 node.type = 'CallExpression';
504 }
505 },
506 VariableDeclarator(node, state, ancestors) {
507 if (ancestors.some(a => nodeIsUniform(a) || nodeIsUniformCallbackFn(a, state.uniformCallbackNames))) {
508 return;

Callers

nothing calls this directly

Calls 3

nodeIsUniformFunction · 0.85
nodeIsUniformCallbackFnFunction · 0.85
atMethod · 0.80

Tested by

no test coverage detected