项目原始demo,不改动
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
 
 
 
 

11 lines
394 B

  1. // @@search logic
  2. require('./_fix-re-wks')('search', 1, function (defined, SEARCH, $search) {
  3. // 21.1.3.15 String.prototype.search(regexp)
  4. return [function search(regexp) {
  5. 'use strict';
  6. var O = defined(this);
  7. var fn = regexp == undefined ? undefined : regexp[SEARCH];
  8. return fn !== undefined ? fn.call(regexp, O) : new RegExp(regexp)[SEARCH](String(O));
  9. }, $search];
  10. });