| 1 | /** |
| 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. |
| 3 | * |
| 4 | * This source code is licensed under the MIT license found in the |
| 5 | * LICENSE file in the root directory of this source tree. |
| 6 | * |
| 7 | * @flow |
| 8 | */ |
| 9 | |
| 10 | import * as React from 'react'; |
| 11 | |
| 12 | const objectWithModifiedHasOwnProperty = { |
| 13 | foo: 'abc', |
| 14 | bar: 123, |
| 15 | hasOwnProperty: true, |
| 16 | }; |
| 17 | |
| 18 | const objectWithNullProto = Object.create(null); |
| 19 | // $FlowFixMe[prop-missing] found when upgrading Flow |
| 20 | objectWithNullProto.foo = 'abc'; |
| 21 | // $FlowFixMe[prop-missing] found when upgrading Flow |
| 22 | objectWithNullProto.bar = 123; |
| 23 | |
| 24 | export default function EdgeCaseObjects(): React.Node { |
| 25 | return ( |
| 26 | <ChildComponent |
| 27 | objectWithModifiedHasOwnProperty={objectWithModifiedHasOwnProperty} |
| 28 | objectWithNullProto={objectWithNullProto} |
| 29 | /> |
| 30 | ); |
| 31 | } |
| 32 | |
| 33 | function ChildComponent(props: any) { |
| 34 | return null; |
| 35 | } |