main
Last change
on this file was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago |
Update repo after prototype presentation
|
-
Property mode
set to
100644
|
File size:
621 bytes
|
Line | |
---|
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');
|
---|
10 | var Type = require('./Type');
|
---|
11 |
|
---|
12 | // https://262.ecma-international.org/6.0/#sec-isconcatspreadable
|
---|
13 |
|
---|
14 | module.exports = function IsConcatSpreadable(O) {
|
---|
15 | if (Type(O) !== 'Object') {
|
---|
16 | return false;
|
---|
17 | }
|
---|
18 | if ($isConcatSpreadable) {
|
---|
19 | var spreadable = Get(O, $isConcatSpreadable);
|
---|
20 | if (typeof spreadable !== 'undefined') {
|
---|
21 | return ToBoolean(spreadable);
|
---|
22 | }
|
---|
23 | }
|
---|
24 | return IsArray(O);
|
---|
25 | };
|
---|
Note:
See
TracBrowser
for help on using the repository browser.