Skip to content

Commit

Permalink
Do not overwrite Object.freeze
Browse files Browse the repository at this point in the history
Summary: Now that React Native ships with a newer version of JSC, we do not need this code to wrap `Object.freeze` any longer.

Reviewed By: mmmulani

Differential Revision: D14779239

fbshipit-source-id: 1a6e1a9c7f4312572bd08ba604fa8c9d6b1927e1
  • Loading branch information
cpojer authored and facebook-github-bot committed Apr 4, 2019
1 parent d9a8222 commit c36151e
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 46 deletions.
2 changes: 0 additions & 2 deletions Libraries/Core/__tests__/MapAndSetPolyfills-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ const {freeze, seal, preventExtensions} = Object;

function setup() {
jest.setMock('../../vendor/core/_shouldPolyfillES6Collection', () => true);
jest.unmock('_wrapObjectFreezeAndFriends');
require('_wrapObjectFreezeAndFriends');
}

function cleanup() {
Expand Down
2 changes: 0 additions & 2 deletions Libraries/Core/polyfillES6Collections.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@ const {polyfillGlobal} = require('PolyfillFunctions');
*/
const _shouldPolyfillCollection = require('_shouldPolyfillES6Collection');
if (_shouldPolyfillCollection('Map')) {
require('_wrapObjectFreezeAndFriends');
polyfillGlobal('Map', () => require('Map'));
}
if (_shouldPolyfillCollection('Set')) {
require('_wrapObjectFreezeAndFriends');
polyfillGlobal('Set', () => require('Set'));
}
3 changes: 0 additions & 3 deletions Libraries/vendor/core/Map.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ module.exports = (function(global, undefined) {
return global.Map;
}

// In case this module has not already been evaluated, import it now.
require('./_wrapObjectFreezeAndFriends');

const hasOwn = Object.prototype.hasOwnProperty;

/**
Expand Down
39 changes: 0 additions & 39 deletions Libraries/vendor/core/_wrapObjectFreezeAndFriends.js

This file was deleted.

0 comments on commit c36151e

Please sign in to comment.