Skip to content

Commit 8a62583

Browse files
sheepsteakfacebook-github-bot
authored andcommitted
Fix mislabelled polyfills for Object.entries and Object.values (#31880)
Summary: The polyfills for `Object.entries` and `Object.values` are in a file named `Object.es7.js` when these APIs form part of ES8/ES2017 (https://en.wikipedia.org/wiki/ECMAScript#8th_Edition_–_ECMAScript_2017). The docs (https://reactnative.dev/docs/javascript-environment#polyfills) list these correctly as ES8 so I thought it might reduce confusion if anyone starts looking into the polyfills in the future like I did. ## Changelog <!-- Help reviewers and the release process by writing your own changelog entry. For an example, see: https://github.com/facebook/react-native/wiki/Changelog --> [Internal] [Fixed] - Fix filename to include correct ECMA spec Pull Request resolved: #31880 Test Plan: All unit tests pass. Reviewed By: yungsters Differential Revision: D29820165 Pulled By: ShikaSD fbshipit-source-id: 2a4eb58bed7b7a4089406665c5c9115cb1773ff6
1 parent d9e0ea7 commit 8a62583

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

jest/setup.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
const MockNativeMethods = jest.requireActual('./MockNativeMethods');
1313
const mockComponent = jest.requireActual('./mockComponent');
1414

15-
jest.requireActual('@react-native/polyfills/Object.es7');
15+
jest.requireActual('@react-native/polyfills/Object.es8');
1616
jest.requireActual('@react-native/polyfills/error-guard');
1717

1818
global.__DEV__ = true;
File renamed without changes.

packages/polyfills/__tests__/Object.es7-test.js renamed to packages/polyfills/__tests__/Object.es8-test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@
1010

1111
'use strict';
1212

13-
describe('Object (ES7)', () => {
13+
describe('Object (ES8)', () => {
1414
beforeEach(() => {
1515
delete Object.entries;
1616
delete Object.values;
1717
jest.resetModules();
18-
require('../Object.es7');
18+
require('../Object.es8');
1919
});
2020

2121
describe('Object.entries', () => {

packages/polyfills/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@
1212
module.exports = () => [
1313
require.resolve('./console.js'),
1414
require.resolve('./error-guard.js'),
15-
require.resolve('./Object.es7.js'),
15+
require.resolve('./Object.es8.js'),
1616
];

0 commit comments

Comments
 (0)