Skip to content

Commit

Permalink
3.27.1
Browse files Browse the repository at this point in the history
  • Loading branch information
zloirock committed Dec 29, 2022
1 parent 98995dc commit f44604e
Show file tree
Hide file tree
Showing 13 changed files with 73 additions and 26 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
## Changelog
##### Unreleased
- Nothing

##### [3.27.1 - 2022.12.30](https://github.com/zloirock/core-js/releases/tag/v3.27.1)
- Fixed a Chakra-based MS Edge (18-) bug that unfreeze (O_o) frozen arrays used as `WeakMap` keys
- Fixing of the previous bug also fixes some cases of `String.dedent` in MS Edge
- Fixed dependencies of some entries
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,11 +203,11 @@ structuredClone(new Set([1, 2, 3])); // => new Set([1, 2, 3])
### Installation:[](#index)
```sh
// global version
npm install --save core-js@3.27.0
npm install --save core-js@3.27.1
// version without global namespace pollution
npm install --save core-js-pure@3.27.0
npm install --save core-js-pure@3.27.1
// bundled global version
npm install --save core-js-bundle@3.27.0
npm install --save core-js-bundle@3.27.1
```

Or you can use `core-js` [from CDN](https://www.jsdelivr.com/package/npm/core-js-bundle).
Expand Down
2 changes: 1 addition & 1 deletion deno/corejs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

*Example*:
```js
import 'https://deno.land/x/corejs@v3.27.0/index.js'; // <- at the top of your entry point
import 'https://deno.land/x/corejs@v3.27.1/index.js'; // <- at the top of your entry point

Object.hasOwn({ foo: 42 }, 'foo'); // => true

Expand Down
57 changes: 49 additions & 8 deletions deno/corejs/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* core-js 3.27.0
* core-js 3.27.1
* © 2014-2022 Denis Pushkarev (zloirock.ru)
* license: https://github.com/zloirock/core-js/blob/v3.27.0/LICENSE
* license: https://github.com/zloirock/core-js/blob/v3.27.1/LICENSE
* source: https://github.com/zloirock/core-js
*/
!function (undefined) { 'use strict'; /******/ (function(modules) { // webpackBootstrap
Expand Down Expand Up @@ -939,10 +939,10 @@ var store = __webpack_require__(36);
(module.exports = function (key, value) {
return store[key] || (store[key] = value !== undefined ? value : {});
})('versions', []).push({
version: '3.27.0',
version: '3.27.1',
mode: IS_PURE ? 'pure' : 'global',
copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
license: 'https://github.com/zloirock/core-js/blob/v3.27.0/LICENSE',
license: 'https://github.com/zloirock/core-js/blob/v3.27.1/LICENSE',
source: 'https://github.com/zloirock/core-js'
});

Expand Down Expand Up @@ -7831,17 +7831,34 @@ __webpack_require__(242);

"use strict";

var FREEZING = __webpack_require__(238);
var global = __webpack_require__(3);
var uncurryThis = __webpack_require__(13);
var defineBuiltIns = __webpack_require__(166);
var InternalMetadataModule = __webpack_require__(232);
var collection = __webpack_require__(231);
var collectionWeak = __webpack_require__(243);
var isObject = __webpack_require__(19);
var isExtensible = __webpack_require__(236);
var enforceInternalState = __webpack_require__(51).enforce;
var fails = __webpack_require__(6);
var NATIVE_WEAK_MAP = __webpack_require__(52);

var $Object = Object;
// eslint-disable-next-line es/no-array-isarray -- safe
var isArray = Array.isArray;
// eslint-disable-next-line es/no-object-isextensible -- safe
var isExtensible = $Object.isExtensible;
// eslint-disable-next-line es/no-object-isfrozen -- safe
var isFrozen = $Object.isFrozen;
// eslint-disable-next-line es/no-object-issealed -- safe
var isSealed = $Object.isSealed;
// eslint-disable-next-line es/no-object-freeze -- safe
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 @@ -7854,18 +7871,27 @@ var wrapper = function (init) {
// `WeakMap` constructor
// https://tc39.es/ecma262/#sec-weakmap-constructor
var $WeakMap = collection('WeakMap', wrapper, collectionWeak);
var WeakMapPrototype = $WeakMap.prototype;
var nativeSet = uncurryThis(WeakMapPrototype.set);

// Chakra Edge bug: adding frozen arrays to WeakMap unfreeze them
var hasMSEdgeFreezingBug = function () {
return FREEZING && fails(function () {
var frozenArray = freeze([]);
nativeSet(new $WeakMap(), frozenArray, 1);
return !isFrozen(frozenArray);
});
};

// IE11 WeakMap frozen keys fix
// We can't use feature detection because it crash some old IE builds
// https://github.com/zloirock/core-js/issues/485
if (NATIVE_WEAK_MAP && IS_IE11) {
if (NATIVE_WEAK_MAP) if (IS_IE11) {
InternalWeakMap = collectionWeak.getConstructor(wrapper, 'WeakMap', true);
InternalMetadataModule.enable();
var WeakMapPrototype = $WeakMap.prototype;
var nativeDelete = uncurryThis(WeakMapPrototype['delete']);
var nativeHas = uncurryThis(WeakMapPrototype.has);
var nativeGet = uncurryThis(WeakMapPrototype.get);
var nativeSet = uncurryThis(WeakMapPrototype.set);
defineBuiltIns(WeakMapPrototype, {
'delete': function (key) {
if (isObject(key) && !isExtensible(key)) {
Expand Down Expand Up @@ -7897,6 +7923,21 @@ if (NATIVE_WEAK_MAP && IS_IE11) {
return this;
}
});
// Chakra Edge frozen keys fix
} else if (hasMSEdgeFreezingBug()) {
defineBuiltIns(WeakMapPrototype, {
set: function set(key, value) {
var arrayIntegrityLevel;
if (isArray(key)) {
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);
return this;
}
});
}


Expand Down
4 changes: 2 additions & 2 deletions docs/compat/compat-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -5465,7 +5465,7 @@
"chrome": "51",
"chrome-android": "51",
"deno": "1.0",
"edge": "15",
"edge": "79",
"electron": "1.2",
"firefox": "53",
"firefox-android": "53",
Expand All @@ -5486,7 +5486,7 @@
"chrome": "51",
"chrome-android": "51",
"deno": "1.0",
"edge": "15",
"edge": "79",
"electron": "1.2",
"firefox": "53",
"firefox-android": "53",
Expand Down
7 changes: 5 additions & 2 deletions docs/compat/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -1364,7 +1364,7 @@ GLOBAL.tests = {
return unescape;
},
'es.weak-map.constructor': [SAFE_ITERATION_CLOSING_SUPPORT, function () {
var key = Object.freeze({});
var key = Object.freeze([]);
var called = 0;
var iterable = {
next: function () {
Expand All @@ -1376,10 +1376,13 @@ GLOBAL.tests = {
};

var map = new WeakMap(iterable);
// MS IE bug
return map.get(key) == 1
&& map.get(null) == undefined
&& map.set({}, 2) == map
&& map[Symbol.toStringTag];
&& map[Symbol.toStringTag]
// MS Edge bug
&& Object.isFrozen(key);
}],
'es.weak-set.constructor': [SAFE_ITERATION_CLOSING_SUPPORT, function () {
var key = {};
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "3.27.0",
"version": "3.27.1",
"repository": {
"type": "git",
"url": "https://github.com/zloirock/core-js.git"
Expand Down
6 changes: 3 additions & 3 deletions packages/core-js-builder/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "core-js-builder",
"version": "3.27.0",
"version": "3.27.1",
"description": "core-js builder",
"repository": {
"type": "git",
Expand All @@ -20,8 +20,8 @@
"sideEffects": false,
"main": "index.js",
"dependencies": {
"core-js": "3.27.0",
"core-js-compat": "3.27.0",
"core-js": "3.27.1",
"core-js-compat": "3.27.1",
"mkdirp": ">=0.5.5 <1",
"webpack": ">=4.46.0 <5"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/core-js-bundle/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "core-js-bundle",
"version": "3.27.0",
"version": "3.27.1",
"description": "Standard library",
"keywords": [
"ES3",
Expand Down
2 changes: 1 addition & 1 deletion packages/core-js-compat/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "core-js-compat",
"version": "3.27.0",
"version": "3.27.1",
"description": "core-js compat",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion packages/core-js-pure/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "core-js-pure",
"version": "3.27.0",
"version": "3.27.1",
"description": "Standard library",
"keywords": [
"ES3",
Expand Down
4 changes: 2 additions & 2 deletions packages/core-js/internals/shared.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ var store = require('../internals/shared-store');
(module.exports = function (key, value) {
return store[key] || (store[key] = value !== undefined ? value : {});
})('versions', []).push({
version: '3.27.0',
version: '3.27.1',
mode: IS_PURE ? 'pure' : 'global',
copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
license: 'https://github.com/zloirock/core-js/blob/v3.27.0/LICENSE',
license: 'https://github.com/zloirock/core-js/blob/v3.27.1/LICENSE',
source: 'https://github.com/zloirock/core-js'
});
2 changes: 1 addition & 1 deletion packages/core-js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "core-js",
"version": "3.27.0",
"version": "3.27.1",
"description": "Standard library",
"keywords": [
"ES3",
Expand Down

0 comments on commit f44604e

Please sign in to comment.