Skip to content

Commit

Permalink
refactor: removed Object.es8 {entries, values} from js polyfills (#…
Browse files Browse the repository at this point in the history
…40747)

Summary:
Both `hermes` and `JSC` supports `Object.{values & entries}`, so this polyfills aren't used any more.

## Changelog:
[GENERAL][REMOVED]: removed `Object.{values & entries}` from polyfills

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests

Pull Request resolved: #40747

Test Plan:
1. We can confirm with `hermes` tests: https://github.com/facebook/hermes/blob/main/test/hermes/object-functions.js#L256
2. Remove this polyfills and check that the code runs as expected.
3. You can also run: `console.log(Object.entries.toString());`  and verify that this is `[native code]`

Reviewed By: christophpurrer

Differential Revision: D50100639

Pulled By: robhogan

fbshipit-source-id: b1cea88bd984e99f304a3a063e985eecff8831dd
  • Loading branch information
ecreeth authored and facebook-github-bot committed Oct 10, 2023
1 parent b7191cd commit 04c501f
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 200 deletions.
58 changes: 0 additions & 58 deletions packages/polyfills/Object.es8.js

This file was deleted.

140 changes: 0 additions & 140 deletions packages/polyfills/__tests__/Object.es8-test.js

This file was deleted.

1 change: 0 additions & 1 deletion packages/polyfills/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,4 @@
module.exports = () => [
require.resolve('./console.js'),
require.resolve('./error-guard.js'),
require.resolve('./Object.es8.js'),
];
1 change: 0 additions & 1 deletion packages/react-native/jest/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
const MockNativeMethods = jest.requireActual('./MockNativeMethods');
const mockComponent = jest.requireActual('./mockComponent');

jest.requireActual('@react-native/js-polyfills/Object.es8');
jest.requireActual('@react-native/js-polyfills/error-guard');

Object.defineProperties(global, {
Expand Down

0 comments on commit 04c501f

Please sign in to comment.