Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1084 from zloirock/find-last
- Loading branch information
Showing
46 changed files
with
244 additions
and
151 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
packages/core-js-pure/override/modules/es.typed-array.find-last-index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
// empty |
1 change: 1 addition & 0 deletions
1
packages/core-js-pure/override/modules/es.typed-array.find-last.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
// empty |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
require('../../modules/esnext.array.find-last-index'); | ||
var entryUnbind = require('../../internals/entry-unbind'); | ||
var parent = require('../../stable/array/find-last-index'); | ||
|
||
module.exports = entryUnbind('Array', 'findLastIndex'); | ||
module.exports = parent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
require('../../modules/esnext.array.find-last'); | ||
var entryUnbind = require('../../internals/entry-unbind'); | ||
var parent = require('../../stable/array/find-last'); | ||
|
||
module.exports = entryUnbind('Array', 'findLast'); | ||
module.exports = parent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
require('../../../modules/esnext.array.find-last-index'); | ||
var entryVirtual = require('../../../internals/entry-virtual'); | ||
var parent = require('../../../stable/array/virtual/find-last-index'); | ||
|
||
module.exports = entryVirtual('Array').findLastIndex; | ||
module.exports = parent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
require('../../../modules/esnext.array.find-last'); | ||
var entryVirtual = require('../../../internals/entry-virtual'); | ||
var parent = require('../../../stable/array/virtual/find-last'); | ||
|
||
module.exports = entryVirtual('Array').findLast; | ||
module.exports = parent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
require('../../modules/esnext.typed-array.find-last-index'); | ||
var parent = require('../../stable/typed-array/find-last-index'); | ||
|
||
module.exports = parent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
require('../../modules/esnext.typed-array.find-last'); | ||
var parent = require('../../stable/typed-array/find-last'); | ||
|
||
module.exports = parent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
require('../../modules/es.array.find-last-index'); | ||
var entryUnbind = require('../../internals/entry-unbind'); | ||
|
||
module.exports = entryUnbind('Array', 'findLastIndex'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
require('../../modules/es.array.find-last'); | ||
var entryUnbind = require('../../internals/entry-unbind'); | ||
|
||
module.exports = entryUnbind('Array', 'findLast'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
require('../../../modules/es.array.find-last-index'); | ||
var entryVirtual = require('../../../internals/entry-virtual'); | ||
|
||
module.exports = entryVirtual('Array').findLastIndex; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
require('../../../modules/es.array.find-last'); | ||
var entryVirtual = require('../../../internals/entry-virtual'); | ||
|
||
module.exports = entryVirtual('Array').findLast; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
var isPrototypeOf = require('../../internals/object-is-prototype-of'); | ||
var method = require('../array/virtual/find-last-index'); | ||
|
||
var ArrayPrototype = Array.prototype; | ||
|
||
module.exports = function (it) { | ||
var own = it.findLastIndex; | ||
return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.findLastIndex) ? method : own; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
var isPrototypeOf = require('../../internals/object-is-prototype-of'); | ||
var method = require('../array/virtual/find-last'); | ||
|
||
var ArrayPrototype = Array.prototype; | ||
|
||
module.exports = function (it) { | ||
var own = it.findLast; | ||
return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.findLast) ? method : own; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
require('../../modules/es.typed-array.find-last-index'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
require('../../modules/es.typed-array.find-last'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
'use strict'; | ||
var $ = require('../internals/export'); | ||
var $findLastIndex = require('../internals/array-iteration-from-last').findLastIndex; | ||
var addToUnscopables = require('../internals/add-to-unscopables'); | ||
|
||
// `Array.prototype.findLastIndex` method | ||
// https://github.com/tc39/proposal-array-find-from-last | ||
$({ target: 'Array', proto: true }, { | ||
findLastIndex: function findLastIndex(callbackfn /* , that = undefined */) { | ||
return $findLastIndex(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); | ||
} | ||
}); | ||
|
||
addToUnscopables('findLastIndex'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
'use strict'; | ||
var $ = require('../internals/export'); | ||
var $findLast = require('../internals/array-iteration-from-last').findLast; | ||
var addToUnscopables = require('../internals/add-to-unscopables'); | ||
|
||
// `Array.prototype.findLast` method | ||
// https://github.com/tc39/proposal-array-find-from-last | ||
$({ target: 'Array', proto: true }, { | ||
findLast: function findLast(callbackfn /* , that = undefined */) { | ||
return $findLast(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); | ||
} | ||
}); | ||
|
||
addToUnscopables('findLast'); |
12 changes: 12 additions & 0 deletions
12
packages/core-js/modules/es.typed-array.find-last-index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
'use strict'; | ||
var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); | ||
var $findLastIndex = require('../internals/array-iteration-from-last').findLastIndex; | ||
|
||
var aTypedArray = ArrayBufferViewCore.aTypedArray; | ||
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; | ||
|
||
// `%TypedArray%.prototype.findLastIndex` method | ||
// https://github.com/tc39/proposal-array-find-from-last | ||
exportTypedArrayMethod('findLastIndex', function findLastIndex(predicate /* , thisArg */) { | ||
return $findLastIndex(aTypedArray(this), predicate, arguments.length > 1 ? arguments[1] : undefined); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
'use strict'; | ||
var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); | ||
var $findLast = require('../internals/array-iteration-from-last').findLast; | ||
|
||
var aTypedArray = ArrayBufferViewCore.aTypedArray; | ||
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; | ||
|
||
// `%TypedArray%.prototype.findLast` method | ||
// https://github.com/tc39/proposal-array-find-from-last | ||
exportTypedArrayMethod('findLast', function findLast(predicate /* , thisArg */) { | ||
return $findLast(aTypedArray(this), predicate, arguments.length > 1 ? arguments[1] : undefined); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,2 @@ | ||
'use strict'; | ||
var $ = require('../internals/export'); | ||
var $findLastIndex = require('../internals/array-iteration-from-last').findLastIndex; | ||
var addToUnscopables = require('../internals/add-to-unscopables'); | ||
|
||
// `Array.prototype.findLastIndex` method | ||
// https://github.com/tc39/proposal-array-find-from-last | ||
$({ target: 'Array', proto: true }, { | ||
findLastIndex: function findLastIndex(callbackfn /* , that = undefined */) { | ||
return $findLastIndex(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); | ||
} | ||
}); | ||
|
||
addToUnscopables('findLastIndex'); | ||
// TODO: Remove from `core-js@4` | ||
require('../modules/es.array.find-last-index'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,2 @@ | ||
'use strict'; | ||
var $ = require('../internals/export'); | ||
var $findLast = require('../internals/array-iteration-from-last').findLast; | ||
var addToUnscopables = require('../internals/add-to-unscopables'); | ||
|
||
// `Array.prototype.findLast` method | ||
// https://github.com/tc39/proposal-array-find-from-last | ||
$({ target: 'Array', proto: true }, { | ||
findLast: function findLast(callbackfn /* , that = undefined */) { | ||
return $findLast(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); | ||
} | ||
}); | ||
|
||
addToUnscopables('findLast'); | ||
// TODO: Remove from `core-js@4` | ||
require('../modules/es.array.find-last'); |
14 changes: 2 additions & 12 deletions
14
packages/core-js/modules/esnext.typed-array.find-last-index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,2 @@ | ||
'use strict'; | ||
var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); | ||
var $findLastIndex = require('../internals/array-iteration-from-last').findLastIndex; | ||
|
||
var aTypedArray = ArrayBufferViewCore.aTypedArray; | ||
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; | ||
|
||
// `%TypedArray%.prototype.findLastIndex` method | ||
// https://github.com/tc39/proposal-array-find-from-last | ||
exportTypedArrayMethod('findLastIndex', function findLastIndex(predicate /* , thisArg */) { | ||
return $findLastIndex(aTypedArray(this), predicate, arguments.length > 1 ? arguments[1] : undefined); | ||
}); | ||
// TODO: Remove from `core-js@4` | ||
require('../modules/es.typed-array.find-last-index'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,2 @@ | ||
'use strict'; | ||
var ArrayBufferViewCore = require('../internals/array-buffer-view-core'); | ||
var $findLast = require('../internals/array-iteration-from-last').findLast; | ||
|
||
var aTypedArray = ArrayBufferViewCore.aTypedArray; | ||
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod; | ||
|
||
// `%TypedArray%.prototype.findLast` method | ||
// https://github.com/tc39/proposal-array-find-from-last | ||
exportTypedArrayMethod('findLast', function findLast(predicate /* , thisArg */) { | ||
return $findLast(aTypedArray(this), predicate, arguments.length > 1 ? arguments[1] : undefined); | ||
}); | ||
// TODO: Remove from `core-js@4` | ||
require('../modules/es.typed-array.find-last'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = require('../../es/array/find-last-index'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = require('../../es/array/find-last'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = require('../../../es/array/virtual/find-last-index'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = require('../../../es/array/virtual/find-last'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
var parent = require('../../es/instance/find-last-index'); | ||
|
||
module.exports = parent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
var parent = require('../../es/instance/find-last'); | ||
|
||
module.exports = parent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = require('../../es/typed-array/find-last-index'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = require('../../es/typed-array/find-last'); |
Oops, something went wrong.