main
Last change
on this file since 79a0317 was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 3 days ago |
F4 Finalna Verzija
|
-
Property mode
set to
100644
|
File size:
631 bytes
|
Rev | Line | |
---|
[d565449] | 1 | 'use strict';
|
---|
| 2 |
|
---|
| 3 | var GetIntrinsic = require('get-intrinsic');
|
---|
| 4 |
|
---|
| 5 | var $isConcatSpreadable = GetIntrinsic('%Symbol.isConcatSpreadable%', true);
|
---|
| 6 |
|
---|
| 7 | var Get = require('./Get');
|
---|
| 8 | var IsArray = require('./IsArray');
|
---|
| 9 | var ToBoolean = require('./ToBoolean');
|
---|
[79a0317] | 10 |
|
---|
| 11 | var isObject = require('../helpers/isObject');
|
---|
[d565449] | 12 |
|
---|
| 13 | // https://262.ecma-international.org/6.0/#sec-isconcatspreadable
|
---|
| 14 |
|
---|
| 15 | module.exports = function IsConcatSpreadable(O) {
|
---|
[79a0317] | 16 | if (!isObject(O)) {
|
---|
[d565449] | 17 | return false;
|
---|
| 18 | }
|
---|
| 19 | if ($isConcatSpreadable) {
|
---|
| 20 | var spreadable = Get(O, $isConcatSpreadable);
|
---|
| 21 | if (typeof spreadable !== 'undefined') {
|
---|
| 22 | return ToBoolean(spreadable);
|
---|
| 23 | }
|
---|
| 24 | }
|
---|
| 25 | return IsArray(O);
|
---|
| 26 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.