mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Use correct var name for element when handling arrays of type aliases
Summary:
Fixes an issue where, if a spec uses an array of elements where the element is a type alias, the generated code would use the wrong variable name.
An example of such a spec can be found in `NativeExceptionsManager.js`:
```
+reportSoftException: (
message: string,
stack: Array<StackFrame>,
exceptionId: number,
) => void;
```
The fix ensures the local variable name is passed through, ensuring that either p or itemValue_N is used when appropriate.
Changelog: [Internal]
Reviewed By: RSNara
Differential Revision: D24116429
fbshipit-source-id: f39b75adb604c751d70a284a11a7fa6649b1344d
This commit is contained in:
committed by
Facebook GitHub Bot
parent
43624dd193
commit
d4937b925b
+2
-2
@@ -195,8 +195,8 @@ function toObjCValue(
|
||||
);
|
||||
|
||||
return !isRequired
|
||||
? `(p == nil ? folly::none : folly::make_optional(${namespacedStructName}(p)))`
|
||||
: `${namespacedStructName}(p)`;
|
||||
? `(${value} == nil ? folly::none : folly::make_optional(${namespacedStructName}(${value})))`
|
||||
: `${namespacedStructName}(${value})`;
|
||||
default:
|
||||
(typeAnnotation.type: empty);
|
||||
throw new Error(
|
||||
|
||||
Reference in New Issue
Block a user