How to use the @babel/runtime/helpers/esm/assertThisInitialized function in @babel/runtime

To help you get started, we’ve selected a few @babel/runtime examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github concentjs / concent / es / core / helper / register.js View on Github external
function CcClass(props, context) {
          var _this;

          try {
            _this = _TargetClass.call(this, props, context) || this;
            if (!_this.state) _this.state = {};
            var ccKey = props.ccKey,
                _props$ccOption = props.ccOption,
                ccOption = _props$ccOption === void 0 ? {} : _props$ccOption;
            var originalCcKey = ccKey;
            util.bindThis(_assertThisInitialized(_this), ['__$$mapCcToInstance', '$$changeState', '__$$recoverState', '$$domDispatch', '$$sync', '__$$getEffectHandler', '__$$getXEffectHandler', '__$$makeEffectHandler', '__$$getInvokeHandler', '__$$getXInvokeHandler', '__$$makeInvokeHandler', '__$$getChangeStateHandler', '__$$getDispatchHandler', '__$$getSyncHandler']); // if you flag syncSharedState false, that means this ccInstance's state changing will not effect other ccInstance and not effected by other ccInstance's state changing

            if (ccOption.syncSharedState === undefined) ccOption.syncSharedState = true; // if you flag syncGlobalState false, that means this ccInstance's globalState changing will not effect cc's globalState and not effected by cc's globalState changing

            if (ccOption.syncGlobalState === undefined) ccOption.syncGlobalState = true;
            if (ccOption.asyncLifecycleHook === undefined) ccOption.asyncLifecycleHook = _asyncLifecycleHook;
            var _asyncLifecycleHook2 = ccOption.asyncLifecycleHook;

            var _computeCcUniqueKey = computeCcUniqueKey(isSingle, ccClassKey, ccKey),
                newCcKey = _computeCcUniqueKey.ccKey,
                ccUniqueKey = _computeCcUniqueKey.ccUniqueKey,
                isCcUniqueKeyAutoGenerated = _computeCcUniqueKey.isCcUniqueKeyAutoGenerated;

            var ccClassContext = ccClassKey_ccClassContext_[ccClassKey];
            setRef(_assertThisInitialized(_this), isSingle, ccClassKey, newCcKey, ccUniqueKey, ccOption); // bind connectedState to $$connectedState

            _this.$$connectedState = ccClassContext.connectedState || {}; // bind refComputed,computed result will been collected into refComputed by __$$recoverState later
github aotuzuche / auto-ui / es / time-picker / index.js View on Github external
}

      if (_this.iScrollHH) {
        _this.iScrollHH.refresh();

        _this.iScrollHH.scrollTo(0, -_this.realScrollRowHeight * _this.state.HHIndex, 300);
      }

      if (_this.iScrollMM) {
        _this.iScrollMM.refresh();

        _this.iScrollMM.scrollTo(0, -_this.realScrollRowHeight * _this.state.MMIndex, 300);
      }
    });

    _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "scrollEndCalc", function (scroll, type) {
      if (_this['needCalc' + type]) {
        var row = Math.floor(-scroll.y / _this.realScrollRowHeight + 0.5);
        var scrollTop = row * _this.realScrollRowHeight;
        scroll.scrollTo(0, -scrollTop, 500);
        _this['needCalc' + type] = false; // 如果是日期滚动,更新小时和分钟数据

        if (type === 'Day') {
          var times = event.transTimeList(event.getTimeList(_this.props.data[row]));
          var hIndex = times.HH.indexOf(_this.state.HHValue);
          var hChange = hIndex === -1;
          hIndex = hIndex > -1 ? hIndex : 0;
          var mIndex = times[times.HH[hIndex]].indexOf(_this.state.MMValue);
          mIndex = mIndex > -1 ? mIndex : 0; // 如果小时变了,那分钟就恢复到默认第一个值
          // 比如 4点45分 切换到另一天,另一天没有4点,则可能取了个0点
          // 这个时候如果分钟不变,时间就变成了0点45分,其实是没意义的,不如直接展示0点0分
github aotuzuche / auto-ui / es / __unstable_time-range / index.js View on Github external
function TimeRange(props) {
    var _this;

    _this = _Component.call(this, props) || this;

    _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "onChange", function (t) {
      var range;

      if (_this.state.current === 0) {
        range = [t, _this.tpB.getTime()];
      } else {
        range = [_this.tpA.getTime(), t];
      }

      _this.props.onChange && _this.props.onChange(range);
    });

    _this.state = {
      current: 1
    };

    if (!props.defaultRange || !Array.isArray(props.defaultRange) || props.defaultRange.length !== 2) {
github sikidamjanovic / cowrite / node_modules / react-redux / es / components / connectAdvanced.js View on Github external
function Connect(props, context) {
        var _this;

        _this = _Component.call(this, props, context) || this;
        _this.version = version;
        _this.state = {};
        _this.renderCount = 0;
        _this.store = props[storeKey] || context[storeKey];
        _this.propsMode = Boolean(props[storeKey]);
        _this.setWrappedInstance = _this.setWrappedInstance.bind(_assertThisInitialized(_assertThisInitialized(_this)));
        invariant(_this.store, "Could not find \"" + storeKey + "\" in either the context or props of " + ("\"" + displayName + "\". Either wrap the root component in a , ") + ("or explicitly pass \"" + storeKey + "\" as a prop to \"" + displayName + "\"."));

        _this.initSelector();

        _this.initSubscription();

        return _this;
      }
github aotuzuche / auto-ui / es / modal / index.js View on Github external
function Modal(props) {
    var _this;

    _this = _Component.call(this, props) || this;

    _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "_onAnimationEnd", function (e) {
      if (_this.state.ani !== 'leave') {
        return;
      }

      _this.setState({
        ani: 'init',
        visible: false
      });
    });

    _this.state = {
      visible: false,
      ani: 'init'
    };
    return _this;
  }
github uiwjs / uiw / packages / core / lib / esm / icon / index.js View on Github external
function Icon() {
    var _getPrototypeOf2;

    var _this;

    _classCallCheck(this, Icon);

    for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
      args[_key] = arguments[_key];
    }

    _this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(Icon)).call.apply(_getPrototypeOf2, [this].concat(args)));

    _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "renderSvgPaths", function (type) {
      var pathStrings = svgPaths[type];

      if (pathStrings == null) {
        return null;
      }

      return pathStrings.map(function (d, i) {
        return React.createElement("path", {
          key: i,
          d: d,
          fillRule: "evenodd"
        });
      });
    });

    return _this;
github facebook / react / packages / react-devtools-shared / src / node_modules / react-window / dist / index.esm.js View on Github external
function Grid(props) {
      var _this;

      _this = _PureComponent.call(this, props) || this;
      _this._instanceProps = initInstanceProps(_this.props, _assertThisInitialized(_assertThisInitialized(_this)));
      _this._resetIsScrollingTimeoutId = null;
      _this._outerRef = void 0;
      _this.state = {
        instance: _assertThisInitialized(_assertThisInitialized(_this)),
        isScrolling: false,
        horizontalScrollDirection: 'forward',
        scrollLeft: typeof _this.props.initialScrollLeft === 'number' ? _this.props.initialScrollLeft : 0,
        scrollTop: typeof _this.props.initialScrollTop === 'number' ? _this.props.initialScrollTop : 0,
        scrollUpdateWasRequested: false,
        verticalScrollDirection: 'forward'
      };
      _this._callOnItemsRendered = void 0;
      _this._callOnItemsRendered = memoizeOne(function (overscanColumnStartIndex, overscanColumnStopIndex, overscanRowStartIndex, overscanRowStopIndex, visibleColumnStartIndex, visibleColumnStopIndex, visibleRowStartIndex, visibleRowStopIndex) {
        return _this.props.onItemsRendered({
          overscanColumnStartIndex: overscanColumnStartIndex,
          overscanColumnStopIndex: overscanColumnStopIndex,
github facebook / react / packages / react-devtools-shared / src / node_modules / react-window / dist / index.esm.js View on Github external
function List(props) {
      var _this;

      _this = _PureComponent.call(this, props) || this;
      _this._instanceProps = initInstanceProps(_this.props, _assertThisInitialized(_assertThisInitialized(_this)));
      _this._outerRef = void 0;
      _this._resetIsScrollingTimeoutId = null;
      _this.state = {
        instance: _assertThisInitialized(_assertThisInitialized(_this)),
        isScrolling: false,
        scrollDirection: 'forward',
        scrollOffset: typeof _this.props.initialScrollOffset === 'number' ? _this.props.initialScrollOffset : 0,
        scrollUpdateWasRequested: false
      };
      _this._callOnItemsRendered = void 0;
      _this._callOnItemsRendered = memoizeOne(function (overscanStartIndex, overscanStopIndex, visibleStartIndex, visibleStopIndex) {
        return _this.props.onItemsRendered({
          overscanStartIndex: overscanStartIndex,
          overscanStopIndex: overscanStopIndex,
          visibleStartIndex: visibleStartIndex,
          visibleStopIndex: visibleStopIndex
        });
      });
      _this._callOnScroll = void 0;
      _this._callOnScroll = memoizeOne(function (scrollDirection, scrollOffset, scrollUpdateWasRequested) {