/*! bxs-vue-ui v3.3.0 */
'use strict';

var normalizeComponent = require('./normalize-component.js');
var aFunction = require('./a-function.js');

var defineProperty = normalizeComponent.definePropertyModule.f;



var TO_STRING_TAG = normalizeComponent.wellKnownSymbol('toStringTag');

var setToStringTag = function (it, TAG, STATIC) {
  if (it && !normalizeComponent.has(it = STATIC ? it : it.prototype, TO_STRING_TAG)) {
    defineProperty(it, TO_STRING_TAG, { configurable: true, value: TAG });
  }
};

// optional / simple context binding
var bindContext = function (fn, that, length) {
  aFunction.aFunction(fn);
  if (that === undefined) return fn;
  switch (length) {
    case 0: return function () {
      return fn.call(that);
    };
    case 1: return function (a) {
      return fn.call(that, a);
    };
    case 2: return function (a, b) {
      return fn.call(that, a, b);
    };
    case 3: return function (a, b, c) {
      return fn.call(that, a, b, c);
    };
  }
  return function (/* ...args */) {
    return fn.apply(that, arguments);
  };
};

exports.bind = bindContext;
exports.setToStringTag = setToStringTag;
