Ignore:
Timestamp:
01/21/25 03:08:24 (3 months ago)
Author:
stefan toskovski <stefantoska84@…>
Branches:
main
Parents:
0c6b92a
Message:

F4 Finalna Verzija

File:
1 edited

Legend:

Unmodified
Added
Removed
  • imaps-frontend/node_modules/call-bind/test/index.js

    r0c6b92a r79a0317  
    22
    33var callBind = require('../');
    4 var bind = require('function-bind');
    5 var gOPD = require('gopd');
    64var hasStrictMode = require('has-strict-mode')();
    75var forEach = require('for-each');
     
    1513 * in io.js v3, it is configurable except on bound functions, hence the .bind()
    1614 */
    17 var functionsHaveConfigurableLengths = !!(
    18         gOPD
    19         && Object.getOwnPropertyDescriptor
    20         && Object.getOwnPropertyDescriptor(bind.call(function () {}), 'length').configurable
    21 );
     15var boundFnsHaveConfigurableLengths = require('set-function-length/env').boundFnsHaveConfigurableLengths;
    2216
    2317test('callBind', function (t) {
     
    4135
    4236        var bound = callBind(func);
    43         t.equal(bound.length, func.length + 1, 'function length is preserved', { skip: !functionsHaveConfigurableLengths });
     37        t.equal(bound.length, func.length + 1, 'function length is preserved', { skip: !boundFnsHaveConfigurableLengths });
    4438        t.deepEqual(bound(), [undefined, undefined, undefined], 'bound func with too few args');
    4539        t.deepEqual(bound(1, 2), [hasStrictMode ? 1 : Object(1), 2, undefined], 'bound func with right args');
     
    4741
    4842        var boundR = callBind(func, sentinel);
    49         t.equal(boundR.length, func.length, 'function length is preserved', { skip: !functionsHaveConfigurableLengths });
     43        t.equal(boundR.length, func.length, 'function length is preserved', { skip: !boundFnsHaveConfigurableLengths });
    5044        t.deepEqual(boundR(), [sentinel, undefined, undefined], 'bound func with receiver, with too few args');
    5145        t.deepEqual(boundR(1, 2), [sentinel, 1, 2], 'bound func with receiver, with right args');
     
    5347
    5448        var boundArg = callBind(func, sentinel, 1);
    55         t.equal(boundArg.length, func.length - 1, 'function length is preserved', { skip: !functionsHaveConfigurableLengths });
     49        t.equal(boundArg.length, func.length - 1, 'function length is preserved', { skip: !boundFnsHaveConfigurableLengths });
    5650        t.deepEqual(boundArg(), [sentinel, 1, undefined], 'bound func with receiver and arg, with too few args');
    5751        t.deepEqual(boundArg(2), [sentinel, 1, 2], 'bound func with receiver and arg, with right arg');
Note: See TracChangeset for help on using the changeset viewer.