MCPcopy Create free account
hub / github.com/NativeScript/NativeScript / AssignmentExpression

Function AssignmentExpression

packages/vite/hmr/server/websocket.ts:3766–3778  ·  view source on GitHub ↗
(path)

Source from the content-addressed store, hash-verified

3764 }
3765 },
3766 AssignmentExpression(path) {
3767 // Guard component.render = <alias> to avoid TDZ when alias is undefined
3768 if (
3769 t.isMemberExpression(path.node.left) &&
3770 t.isIdentifier(path.node.left.property, {
3771 name: 'render',
3772 })
3773 ) {
3774 const e = t.identifier('__e');
3775 const guarded = t.tryStatement(t.blockStatement([t.variableDeclaration('const', [t.variableDeclarator(e, path.node.right as any)]), t.ifStatement(t.logicalExpression('&&', t.binaryExpression('!==', t.unaryExpression('typeof', path.node.left.object as any, true), t.stringLiteral('undefined')), t.binaryExpression('!==', t.unaryExpression('typeof', e, true), t.stringLiteral('undefined'))), t.blockStatement([t.expressionStatement(t.assignmentExpression('=', path.node.left as any, e))]))]), t.catchClause(t.identifier('_e'), t.blockStatement([])));
3776 path.replaceWithMultiple([guarded]);
3777 }
3778 },
3779 });
3780 }
3781 let outCode = genCode(ast as any).code;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected