core-js-pure 3.4.7 → 3.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/es/index.js CHANGED
@@ -105,6 +105,8 @@ require('../modules/es.string.sup');
105
105
  require('../modules/es.regexp.constructor');
106
106
  require('../modules/es.regexp.exec');
107
107
  require('../modules/es.regexp.flags');
108
+ require('../modules/es.regexp.sticky');
109
+ require('../modules/es.regexp.test');
108
110
  require('../modules/es.regexp.to-string');
109
111
  require('../modules/es.parse-int');
110
112
  require('../modules/es.parse-float');
@@ -2,6 +2,8 @@ require('../../modules/es.regexp.constructor');
2
2
  require('../../modules/es.regexp.to-string');
3
3
  require('../../modules/es.regexp.exec');
4
4
  require('../../modules/es.regexp.flags');
5
+ require('../../modules/es.regexp.sticky');
6
+ require('../../modules/es.regexp.test');
5
7
  require('../../modules/es.string.match');
6
8
  require('../../modules/es.string.replace');
7
9
  require('../../modules/es.string.search');
@@ -0,0 +1,5 @@
1
+ require('../../modules/es.regexp.sticky');
2
+
3
+ module.exports = function (it) {
4
+ return it.sticky;
5
+ };
@@ -0,0 +1,5 @@
1
+ require('../../modules/es.regexp.test');
2
+
3
+ module.exports = function (re, string) {
4
+ return RegExp.prototype.test.call(re, string);
5
+ };
@@ -1,3 +1,6 @@
1
+ // TODO: remove from `core-js@4`
2
+ require('../../modules/esnext.string.match-all');
3
+
1
4
  var parent = require('../../es/instance/match-all');
2
5
 
3
6
  module.exports = parent;
@@ -1,3 +1,6 @@
1
1
  var parent = require('../../es/object');
2
+ require('../../modules/esnext.object.iterate-entries');
3
+ require('../../modules/esnext.object.iterate-keys');
4
+ require('../../modules/esnext.object.iterate-values');
2
5
 
3
6
  module.exports = parent;
@@ -0,0 +1,4 @@
1
+ require('../../modules/esnext.object.iterate-entries');
2
+ var path = require('../../internals/path');
3
+
4
+ module.exports = path.Object.iterateEntries;
@@ -0,0 +1,4 @@
1
+ require('../../modules/esnext.object.iterate-keys');
2
+ var path = require('../../internals/path');
3
+
4
+ module.exports = path.Object.iterateKeys;
@@ -0,0 +1,4 @@
1
+ require('../../modules/esnext.object.iterate-values');
2
+ var path = require('../../internals/path');
3
+
4
+ module.exports = path.Object.iterateValues;
@@ -0,0 +1,3 @@
1
+ var parent = require('../../es/regexp/sticky');
2
+
3
+ module.exports = parent;
@@ -0,0 +1,3 @@
1
+ var parent = require('../../es/regexp/test');
2
+
3
+ module.exports = parent;
@@ -1,7 +1,12 @@
1
- var shared = require('../internals/shared');
1
+ var store = require('../internals/shared-store');
2
2
 
3
3
  var functionToString = Function.toString;
4
4
 
5
- module.exports = shared('inspectSource', function (it) {
6
- return functionToString.call(it);
7
- });
5
+ // this helper broken in `3.4.1-3.4.4`, so we can't use `shared` helper
6
+ if (typeof store.inspectSource != 'function') {
7
+ store.inspectSource = function (it) {
8
+ return functionToString.call(it);
9
+ };
10
+ }
11
+
12
+ module.exports = store.inspectSource;
@@ -5,45 +5,74 @@ var hiddenKeys = require('../internals/hidden-keys');
5
5
  var html = require('../internals/html');
6
6
  var documentCreateElement = require('../internals/document-create-element');
7
7
  var sharedKey = require('../internals/shared-key');
8
- var IE_PROTO = sharedKey('IE_PROTO');
9
8
 
9
+ var GT = '>';
10
+ var LT = '<';
10
11
  var PROTOTYPE = 'prototype';
11
- var Empty = function () { /* empty */ };
12
+ var SCRIPT = 'script';
13
+ var IE_PROTO = sharedKey('IE_PROTO');
14
+
15
+ var EmptyConstructor = function () { /* empty */ };
16
+
17
+ var scriptTag = function (content) {
18
+ return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
19
+ };
20
+
21
+ // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
22
+ var NullProtoObjectViaActiveX = function (activeXDocument) {
23
+ activeXDocument.write(scriptTag(''));
24
+ activeXDocument.close();
25
+ var temp = activeXDocument.parentWindow.Object;
26
+ activeXDocument = null; // avoid memory leak
27
+ return temp;
28
+ };
12
29
 
13
30
  // Create object with fake `null` prototype: use iframe Object with cleared prototype
14
- var createDict = function () {
31
+ var NullProtoObjectViaIFrame = function () {
15
32
  // Thrash, waste and sodomy: IE GC bug
16
33
  var iframe = documentCreateElement('iframe');
17
- var length = enumBugKeys.length;
18
- var lt = '<';
19
- var script = 'script';
20
- var gt = '>';
21
- var js = 'java' + script + ':';
34
+ var JS = 'java' + SCRIPT + ':';
22
35
  var iframeDocument;
23
36
  iframe.style.display = 'none';
24
37
  html.appendChild(iframe);
25
- iframe.src = String(js);
38
+ // https://github.com/zloirock/core-js/issues/475
39
+ iframe.src = String(JS);
26
40
  iframeDocument = iframe.contentWindow.document;
27
41
  iframeDocument.open();
28
- iframeDocument.write(lt + script + gt + 'document.F=Object' + lt + '/' + script + gt);
42
+ iframeDocument.write(scriptTag('document.F=Object'));
29
43
  iframeDocument.close();
30
- createDict = iframeDocument.F;
31
- while (length--) delete createDict[PROTOTYPE][enumBugKeys[length]];
32
- return createDict();
44
+ return iframeDocument.F;
33
45
  };
34
46
 
47
+ // Check for document.domain and active x support
48
+ // No need to use active x approach when document.domain is not set
49
+ // see https://github.com/es-shims/es5-shim/issues/150
50
+ // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
51
+ // avoid IE GC bug
52
+ var activeXDocument;
53
+ var NullProtoObject = function () {
54
+ try {
55
+ /* global ActiveXObject */
56
+ activeXDocument = document.domain && new ActiveXObject('htmlfile');
57
+ } catch (error) { /* ignore */ }
58
+ NullProtoObject = activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) : NullProtoObjectViaIFrame();
59
+ var length = enumBugKeys.length;
60
+ while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
61
+ return NullProtoObject();
62
+ };
63
+
64
+ hiddenKeys[IE_PROTO] = true;
65
+
35
66
  // `Object.create` method
36
67
  // https://tc39.github.io/ecma262/#sec-object.create
37
68
  module.exports = Object.create || function create(O, Properties) {
38
69
  var result;
39
70
  if (O !== null) {
40
- Empty[PROTOTYPE] = anObject(O);
41
- result = new Empty();
42
- Empty[PROTOTYPE] = null;
71
+ EmptyConstructor[PROTOTYPE] = anObject(O);
72
+ result = new EmptyConstructor();
73
+ EmptyConstructor[PROTOTYPE] = null;
43
74
  // add "__proto__" for Object.getPrototypeOf polyfill
44
75
  result[IE_PROTO] = O;
45
- } else result = createDict();
76
+ } else result = NullProtoObject();
46
77
  return Properties === undefined ? result : defineProperties(result, Properties);
47
78
  };
48
-
49
- hiddenKeys[IE_PROTO] = true;
@@ -0,0 +1,37 @@
1
+ 'use strict';
2
+ var InternalStateModule = require('../internals/internal-state');
3
+ var createIteratorConstructor = require('../internals/create-iterator-constructor');
4
+ var has = require('../internals/has');
5
+ var objectKeys = require('../internals/object-keys');
6
+ var toObject = require('../internals/to-object');
7
+
8
+ var OBJECT_ITERATOR = 'Object Iterator';
9
+ var setInternalState = InternalStateModule.set;
10
+ var getInternalState = InternalStateModule.getterFor(OBJECT_ITERATOR);
11
+
12
+ module.exports = createIteratorConstructor(function ObjectIterator(source, mode) {
13
+ var object = toObject(source);
14
+ setInternalState(this, {
15
+ type: OBJECT_ITERATOR,
16
+ mode: mode,
17
+ object: object,
18
+ keys: objectKeys(object),
19
+ index: 0
20
+ });
21
+ }, 'Object', function next() {
22
+ var state = getInternalState(this);
23
+ var keys = state.keys;
24
+ while (true) {
25
+ if (keys === null || state.index >= keys.length) {
26
+ state.object = state.keys = null;
27
+ return { value: undefined, done: true };
28
+ }
29
+ var key = keys[state.index++];
30
+ var object = state.object;
31
+ if (!has(object, key)) continue;
32
+ switch (state.mode) {
33
+ case 'keys': return { value: key, done: false };
34
+ case 'values': return { value: object[key], done: false };
35
+ } /* entries */ return { value: [key, object[key]], done: false };
36
+ }
37
+ });
@@ -0,0 +1 @@
1
+ // empty
@@ -4,7 +4,7 @@ var store = require('../internals/shared-store');
4
4
  (module.exports = function (key, value) {
5
5
  return store[key] || (store[key] = value !== undefined ? value : {});
6
6
  })('versions', []).push({
7
- version: '3.4.7',
7
+ version: '3.6.1',
8
8
  mode: IS_PURE ? 'pure' : 'global',
9
9
  copyright: '© 2019 Denis Pushkarev (zloirock.ru)'
10
10
  });
@@ -4,4 +4,4 @@ module.exports = NATIVE_SYMBOL
4
4
  // eslint-disable-next-line no-undef
5
5
  && !Symbol.sham
6
6
  // eslint-disable-next-line no-undef
7
- && typeof Symbol() == 'symbol';
7
+ && typeof Symbol.iterator == 'symbol';
@@ -7,7 +7,7 @@ var USE_SYMBOL_AS_UID = require('../internals/use-symbol-as-uid');
7
7
 
8
8
  var WellKnownSymbolsStore = shared('wks');
9
9
  var Symbol = global.Symbol;
10
- var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol : uid;
10
+ var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol : Symbol && Symbol.withoutSetter || uid;
11
11
 
12
12
  module.exports = function (name) {
13
13
  if (!has(WellKnownSymbolsStore, name)) {
@@ -0,0 +1 @@
1
+ // empty
@@ -0,0 +1 @@
1
+ // empty
@@ -83,7 +83,7 @@ var wrap = function (tag, description) {
83
83
  return symbol;
84
84
  };
85
85
 
86
- var isSymbol = NATIVE_SYMBOL && typeof $Symbol.iterator == 'symbol' ? function (it) {
86
+ var isSymbol = USE_SYMBOL_AS_UID ? function (it) {
87
87
  return typeof it == 'symbol';
88
88
  } : function (it) {
89
89
  return Object(it) instanceof $Symbol;
@@ -178,12 +178,20 @@ if (!NATIVE_SYMBOL) {
178
178
  return getInternalState(this).tag;
179
179
  });
180
180
 
181
+ redefine($Symbol, 'withoutSetter', function (description) {
182
+ return wrap(uid(description), description);
183
+ });
184
+
181
185
  propertyIsEnumerableModule.f = $propertyIsEnumerable;
182
186
  definePropertyModule.f = $defineProperty;
183
187
  getOwnPropertyDescriptorModule.f = $getOwnPropertyDescriptor;
184
188
  getOwnPropertyNamesModule.f = getOwnPropertyNamesExternal.f = $getOwnPropertyNames;
185
189
  getOwnPropertySymbolsModule.f = $getOwnPropertySymbols;
186
190
 
191
+ wrappedWellKnownSymbolModule.f = function (name) {
192
+ return wrap(wellKnownSymbol(name), name);
193
+ };
194
+
187
195
  if (DESCRIPTORS) {
188
196
  // https://github.com/tc39/proposal-Symbol-description
189
197
  nativeDefineProperty($Symbol[PROTOTYPE], 'description', {
@@ -198,12 +206,6 @@ if (!NATIVE_SYMBOL) {
198
206
  }
199
207
  }
200
208
 
201
- if (!USE_SYMBOL_AS_UID) {
202
- wrappedWellKnownSymbolModule.f = function (name) {
203
- return wrap(wellKnownSymbol(name), name);
204
- };
205
- }
206
-
207
209
  $({ global: true, wrap: true, forced: !NATIVE_SYMBOL, sham: !NATIVE_SYMBOL }, {
208
210
  Symbol: $Symbol
209
211
  });
@@ -0,0 +1,11 @@
1
+ 'use strict';
2
+ var $ = require('../internals/export');
3
+ var ObjectIterator = require('../internals/object-iterator');
4
+
5
+ // `Object.iterateEntries` method
6
+ // https://github.com/tc39/proposal-object-iteration
7
+ $({ target: 'Object', stat: true }, {
8
+ iterateEntries: function iterateEntries(object) {
9
+ return new ObjectIterator(object, 'entries');
10
+ }
11
+ });
@@ -0,0 +1,11 @@
1
+ 'use strict';
2
+ var $ = require('../internals/export');
3
+ var ObjectIterator = require('../internals/object-iterator');
4
+
5
+ // `Object.iterateKeys` method
6
+ // https://github.com/tc39/proposal-object-iteration
7
+ $({ target: 'Object', stat: true }, {
8
+ iterateKeys: function iterateKeys(object) {
9
+ return new ObjectIterator(object, 'keys');
10
+ }
11
+ });
@@ -0,0 +1,11 @@
1
+ 'use strict';
2
+ var $ = require('../internals/export');
3
+ var ObjectIterator = require('../internals/object-iterator');
4
+
5
+ // `Object.iterateValues` method
6
+ // https://github.com/tc39/proposal-object-iteration
7
+ $({ target: 'Object', stat: true }, {
8
+ iterateValues: function iterateValues(object) {
9
+ return new ObjectIterator(object, 'values');
10
+ }
11
+ });
@@ -1,6 +1,7 @@
1
1
  require('./es.array.iterator');
2
2
  var DOMIterables = require('../internals/dom-iterables');
3
3
  var global = require('../internals/global');
4
+ var classof = require('../internals/classof');
4
5
  var createNonEnumerableProperty = require('../internals/create-non-enumerable-property');
5
6
  var Iterators = require('../internals/iterators');
6
7
  var wellKnownSymbol = require('../internals/well-known-symbol');
@@ -10,7 +11,7 @@ var TO_STRING_TAG = wellKnownSymbol('toStringTag');
10
11
  for (var COLLECTION_NAME in DOMIterables) {
11
12
  var Collection = global[COLLECTION_NAME];
12
13
  var CollectionPrototype = Collection && Collection.prototype;
13
- if (CollectionPrototype && !CollectionPrototype[TO_STRING_TAG]) {
14
+ if (CollectionPrototype && classof(CollectionPrototype) !== TO_STRING_TAG) {
14
15
  createNonEnumerableProperty(CollectionPrototype, TO_STRING_TAG, COLLECTION_NAME);
15
16
  }
16
17
  Iterators[COLLECTION_NAME] = Iterators.Array;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "core-js-pure",
3
3
  "description": "Standard library",
4
- "version": "3.4.7",
4
+ "version": "3.6.1",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/zloirock/core-js.git"
@@ -0,0 +1,3 @@
1
+ require('../modules/esnext.object.iterate-entries');
2
+ require('../modules/esnext.object.iterate-keys');
3
+ require('../modules/esnext.object.iterate-values');
@@ -0,0 +1,3 @@
1
+ var parent = require('../../es/regexp/sticky');
2
+
3
+ module.exports = parent;
@@ -0,0 +1,3 @@
1
+ var parent = require('../../es/regexp/test');
2
+
3
+ module.exports = parent;
package/stage/1.js CHANGED
@@ -5,6 +5,7 @@ require('../proposals/keys-composition');
5
5
  require('../proposals/math-extensions');
6
6
  require('../proposals/math-signbit');
7
7
  require('../proposals/number-from-string');
8
+ require('../proposals/object-iteration');
8
9
  require('../proposals/observable');
9
10
  require('../proposals/pattern-matching');
10
11
  require('../proposals/promise-try');