Remove need to copy JSI arguments

Summary:
Since the generated functions move JSI arguments as rvalues into these methods, using const lvaue references doesn't provide any benefit, and in fact hinders our ability to *move* arguments somewhere else and instead requires having to confusingly copy them instead (which JSI makes more difficult).

Changelog:
Internal

Reviewed By: nlutsenko

Differential Revision: D34704455

fbshipit-source-id: 520a358d8a7adeb848e7d7eb204f7154f8f4b58d
This commit is contained in:
Scott Kyle
2022-03-07 19:21:51 -08:00
committed by Facebook GitHub Bot
parent 269fa37bb8
commit ceeb8ec8b1
2 changed files with 19 additions and 24 deletions
@@ -152,12 +152,7 @@ module.exports = {
`Unsupported type for param "${param.name}" in ${prop.name}. Found: ${typeName}`,
resolveAlias,
);
const isObject = translatedParam.startsWith('jsi::');
return (
(isObject
? 'const ' + translatedParam + ' &'
: translatedParam + ' ') + param.name
);
return `${translatedParam} ${param.name}`;
})
.join(', ');
return propertyTemplate