core-js 2.6.6 → 2.6.10

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.
@@ -1,2 +1,2 @@
1
- var core = module.exports = { version: '2.6.6' };
1
+ var core = module.exports = { version: '2.6.10' };
2
2
  if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef
@@ -41,7 +41,7 @@ var SymbolRegistry = shared('symbol-registry');
41
41
  var AllSymbols = shared('symbols');
42
42
  var OPSymbols = shared('op-symbols');
43
43
  var ObjectProto = Object[PROTOTYPE];
44
- var USE_NATIVE = typeof $Symbol == 'function';
44
+ var USE_NATIVE = typeof $Symbol == 'function' && !!$GOPS.f;
45
45
  var QObject = global.QObject;
46
46
  // Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173
47
47
  var setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;
package/modules/_core.js CHANGED
@@ -1,2 +1,2 @@
1
- var core = module.exports = { version: '2.6.6' };
1
+ var core = module.exports = { version: '2.6.10' };
2
2
  if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef
@@ -41,7 +41,7 @@ var SymbolRegistry = shared('symbol-registry');
41
41
  var AllSymbols = shared('symbols');
42
42
  var OPSymbols = shared('op-symbols');
43
43
  var ObjectProto = Object[PROTOTYPE];
44
- var USE_NATIVE = typeof $Symbol == 'function';
44
+ var USE_NATIVE = typeof $Symbol == 'function' && !!$GOPS.f;
45
45
  var QObject = global.QObject;
46
46
  // Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173
47
47
  var setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "core-js",
3
3
  "description": "Standard library",
4
- "version": "2.6.6",
4
+ "version": "2.6.10",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/zloirock/core-js.git"
@@ -38,7 +38,7 @@
38
38
  "promises-tests": "promises-aplus-tests tests/promises-aplus/adapter",
39
39
  "observables-tests": "node tests/observables/adapter && node tests/observables/adapter-library",
40
40
  "test": "npm run grunt clean copy && npm run lint && npm run grunt livescript client karma:default && npm run grunt library karma:library && npm run promises-tests && npm run observables-tests && lsc tests/commonjs",
41
- "postinstall": "node scripts/postinstall"
41
+ "postinstall": "node postinstall || echo \"ignore\""
42
42
  },
43
43
  "license": "MIT",
44
44
  "keywords": [
package/postinstall.js ADDED
@@ -0,0 +1,49 @@
1
+ /* eslint-disable max-len */
2
+ var fs = require('fs');
3
+ var os = require('os');
4
+ var path = require('path');
5
+ var env = process.env;
6
+
7
+ var ADBLOCK = is(env.ADBLOCK);
8
+ var CI = is(env.CI);
9
+ var COLOR = is(env.npm_config_color);
10
+ var DISABLE_OPENCOLLECTIVE = is(env.DISABLE_OPENCOLLECTIVE);
11
+ var SILENT = ['silent', 'error', 'warn'].indexOf(env.npm_config_loglevel) !== -1;
12
+ var MINUTE = 60 * 1000;
13
+
14
+ var BANNER = '\u001B[96mThank you for using core-js (\u001B[94m https://github.com/zloirock/core-js \u001B[96m) for polyfilling JavaScript standard library!\u001B[0m\n\n' +
15
+ '\u001B[96mThe project needs your help! Please consider supporting of core-js on Open Collective or Patreon: \u001B[0m\n' +
16
+ '\u001B[96m>\u001B[94m https://opencollective.com/core-js \u001B[0m\n' +
17
+ '\u001B[96m>\u001B[94m https://www.patreon.com/zloirock \u001B[0m\n\n' +
18
+ '\u001B[96mAlso, the author of core-js (\u001B[94m https://github.com/zloirock \u001B[96m) is looking for a good job -)\u001B[0m\n';
19
+
20
+ function is(it) {
21
+ return !!it && it !== '0' && it !== 'false';
22
+ }
23
+
24
+ function isBannerRequired() {
25
+ if (ADBLOCK || CI || DISABLE_OPENCOLLECTIVE || SILENT) return false;
26
+ var file = path.join(os.tmpdir(), 'core-js-banners');
27
+ var banners = [];
28
+ try {
29
+ var DELTA = Date.now() - fs.statSync(file).mtime;
30
+ if (DELTA >= 0 && DELTA < MINUTE * 3) {
31
+ banners = JSON.parse(fs.readFileSync(file, 'utf8'));
32
+ if (banners.indexOf(BANNER) !== -1) return false;
33
+ }
34
+ } catch (error) {
35
+ banners = [];
36
+ }
37
+ try {
38
+ banners.push(BANNER);
39
+ fs.writeFileSync(file, JSON.stringify(banners), 'utf8');
40
+ } catch (error) { /* empty */ }
41
+ return true;
42
+ }
43
+
44
+ function showBanner() {
45
+ // eslint-disable-next-line no-console,no-control-regex
46
+ console.log(COLOR ? BANNER : BANNER.replace(/\u001B\[\d+m/g, ''));
47
+ }
48
+
49
+ if (isBannerRequired()) showBanner();
@@ -1,12 +0,0 @@
1
- /* eslint-disable no-console,max-len */
2
- var env = process.env;
3
- var CI = !!env.CI && env.CI !== '0' && env.CI !== 'false';
4
- var SILENT = !!~['silent', 'error', 'warn'].indexOf(env.npm_config_loglevel);
5
-
6
- if (!CI && !SILENT) {
7
- console.log('\u001B[96mThank you for using core-js (\u001B[94mhttps://github.com/zloirock/core-js\u001B[96m)!\u001B[0m\n');
8
- console.log('\u001B[96mPlease consider supporting of core-js on Open Collective or Patreon:\u001B[0m');
9
- console.log('\u001B[96m> \u001B[94mhttps://opencollective.com/core-js\u001B[0m');
10
- console.log('\u001B[96m> \u001B[94mhttps://www.patreon.com/zloirock\u001B[0m\n');
11
- console.log('\u001B[96mAlso, the author of core-js (\u001B[94mhttps://github.com/zloirock\u001B[96m) is looking for a good job -)\u001B[0m\n');
12
- }