Skip to content

Commit

Permalink
remove unnecessary usage of fails
Browse files Browse the repository at this point in the history
  • Loading branch information
zloirock committed Nov 26, 2019
1 parent 7a57493 commit 6e1b877
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions packages/core-js/modules/es.string.ends-with.js
@@ -1,6 +1,5 @@
'use strict';
var $ = require('../internals/export');
var fails = require('../internals/fails');
var getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f;
var toLength = require('../internals/to-length');
var notARegExp = require('../internals/not-a-regexp');
Expand All @@ -13,10 +12,10 @@ var min = Math.min;

var CORRECT_IS_REGEXP_LOGIC = correctIsRegExpLogic('endsWith');
// https://github.com/zloirock/core-js/pull/702
var MDN_POLYFILL_BUG = !IS_PURE && !CORRECT_IS_REGEXP_LOGIC && fails(function () {
var MDN_POLYFILL_BUG = !IS_PURE && !CORRECT_IS_REGEXP_LOGIC && !!function () {
var descriptor = getOwnPropertyDescriptor(String.prototype, 'endsWith');
return descriptor && !descriptor.writable;
});
}();

// `String.prototype.endsWith` method
// https://tc39.github.io/ecma262/#sec-string.prototype.endswith
Expand Down
5 changes: 2 additions & 3 deletions packages/core-js/modules/es.string.starts-with.js
@@ -1,6 +1,5 @@
'use strict';
var $ = require('../internals/export');
var fails = require('../internals/fails');
var getOwnPropertyDescriptor = require('../internals/object-get-own-property-descriptor').f;
var toLength = require('../internals/to-length');
var notARegExp = require('../internals/not-a-regexp');
Expand All @@ -13,10 +12,10 @@ var min = Math.min;

var CORRECT_IS_REGEXP_LOGIC = correctIsRegExpLogic('startsWith');
// https://github.com/zloirock/core-js/pull/702
var MDN_POLYFILL_BUG = !IS_PURE && !CORRECT_IS_REGEXP_LOGIC && fails(function () {
var MDN_POLYFILL_BUG = !IS_PURE && !CORRECT_IS_REGEXP_LOGIC && !!function () {
var descriptor = getOwnPropertyDescriptor(String.prototype, 'startsWith');
return descriptor && !descriptor.writable;
});
}();

// `String.prototype.startsWith` method
// https://tc39.github.io/ecma262/#sec-string.prototype.startswith
Expand Down

0 comments on commit 6e1b877

Please sign in to comment.