source: frontend/node_modules/es-array-method-boxes-properly/index.js

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 11 days ago

Fix frontend appearance

  • Property mode set to 100644
File size: 743 bytes
Line 
1module.exports = function properlyBoxed(method) {
2 // Check node 0.6.21 bug where third parameter is not boxed
3 var properlyBoxesNonStrict = true;
4 var properlyBoxesStrict = true;
5 var threwException = false;
6 if (typeof method === 'function') {
7 try {
8 // eslint-disable-next-line max-params
9 method.call('f', function (_, __, O) {
10 if (typeof O !== 'object') {
11 properlyBoxesNonStrict = false;
12 }
13 });
14
15 method.call(
16 [null],
17 function () {
18 'use strict';
19
20 properlyBoxesStrict = typeof this === 'string'; // eslint-disable-line no-invalid-this
21 },
22 'x'
23 );
24 } catch (e) {
25 threwException = true;
26 }
27 return !threwException && properlyBoxesNonStrict && properlyBoxesStrict;
28 }
29 return false;
30};
Note: See TracBrowser for help on using the repository browser.