Skip to content

Commit

Permalink
some stylistic changes
Browse files Browse the repository at this point in the history
  • Loading branch information
zloirock committed Dec 28, 2022
1 parent da2e4f8 commit 0f4a279
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions packages/core-js/modules/es.weak-map.constructor.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ var freeze = $Object.freeze;
// eslint-disable-next-line es/no-object-seal -- safe
var seal = $Object.seal;

var FROZEN = {};
var SEALED = {};
var IS_IE11 = !global.ActiveXObject && 'ActiveXObject' in global;
var InternalWeakMap;

Expand All @@ -44,7 +46,7 @@ var nativeSet = uncurryThis(WeakMapPrototype.set);
var hasMSEdgeFreezingBug = function () {
return FREEZING && fails(function () {
var frozenArray = freeze([]);
new $WeakMap().set(frozenArray, 1);
nativeSet(new $WeakMap(), frozenArray, 1);
return !isFrozen(frozenArray);
});
};
Expand Down Expand Up @@ -95,12 +97,12 @@ if (NATIVE_WEAK_MAP) if (IS_IE11) {
set: function set(key, value) {
var arrayIntegrityLevel;
if (isArray(key)) {
if (isFrozen(key)) arrayIntegrityLevel = 'frozen';
else if (isSealed(key)) arrayIntegrityLevel = 'sealed';
if (isFrozen(key)) arrayIntegrityLevel = FROZEN;
else if (isSealed(key)) arrayIntegrityLevel = SEALED;
}
nativeSet(this, key, value);
if (arrayIntegrityLevel === 'frozen') freeze(key);
if (arrayIntegrityLevel === 'sealed') seal(key);
if (arrayIntegrityLevel == FROZEN) freeze(key);
if (arrayIntegrityLevel == SEALED) seal(key);
return this;
}
});
Expand Down

0 comments on commit 0f4a279

Please sign in to comment.