main
Last change
on this file was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 4 days ago |
F4 Finalna Verzija
|
-
Property mode
set to
100644
|
File size:
743 bytes
|
Rev | Line | |
---|
[79a0317] | 1 | 'use strict';
|
---|
| 2 | // TODO: Remove from `core-js@4`
|
---|
| 3 | var DESCRIPTORS = require('../internals/descriptors');
|
---|
| 4 | var addToUnscopables = require('../internals/add-to-unscopables');
|
---|
| 5 | var toObject = require('../internals/to-object');
|
---|
| 6 | var lengthOfArrayLike = require('../internals/length-of-array-like');
|
---|
| 7 | var defineBuiltInAccessor = require('../internals/define-built-in-accessor');
|
---|
| 8 |
|
---|
| 9 | // `Array.prototype.lastIndex` getter
|
---|
| 10 | // https://github.com/keithamus/proposal-array-last
|
---|
| 11 | if (DESCRIPTORS) {
|
---|
| 12 | defineBuiltInAccessor(Array.prototype, 'lastIndex', {
|
---|
| 13 | configurable: true,
|
---|
| 14 | get: function lastIndex() {
|
---|
| 15 | var O = toObject(this);
|
---|
| 16 | var len = lengthOfArrayLike(O);
|
---|
| 17 | return len === 0 ? 0 : len - 1;
|
---|
| 18 | }
|
---|
| 19 | });
|
---|
| 20 |
|
---|
| 21 | addToUnscopables('lastIndex');
|
---|
| 22 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.