source: imaps-frontend/node_modules/es-abstract/2021/IsConcatSpreadable.js@ d565449

main
Last change on this file since d565449 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
RevLine 
[d565449]1'use strict';
2
3var GetIntrinsic = require('get-intrinsic');
4
5var $isConcatSpreadable = GetIntrinsic('%Symbol.isConcatSpreadable%', true);
6
7var Get = require('./Get');
8var IsArray = require('./IsArray');
9var ToBoolean = require('./ToBoolean');
10var Type = require('./Type');
11
12// https://262.ecma-international.org/6.0/#sec-isconcatspreadable
13
14module.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.