code: function (regexp) {
          var res = maybeCallNative(nativeSearch, regexp, this);
          if (res.done) return res.value;
  
          var rx = anObject(regexp);
          var S = String(this);
  
          var previousLastIndex = rx.lastIndex;
          if (!sameValue(previousLastIndex, 0)) rx.lastIndex = 0;
          var result = regExpExec(rx, S);
          if (!sameValue(rx.lastIndex, previousLastIndex)) rx.lastIndex = previousLastIndex;
          return result === null ? -1 : result.index;
        }
docs: `RegExp.prototype[@@search]` method https://tc39.github.io/ecma262/#sec-regexp.prototype-@@search