Node-Red configuration
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.

regexp-exec-abstract.js 700B

123456789101112131415161718192021
  1. 'use strict';
  2. var call = require('../internals/function-call');
  3. var anObject = require('../internals/an-object');
  4. var isCallable = require('../internals/is-callable');
  5. var classof = require('../internals/classof-raw');
  6. var regexpExec = require('../internals/regexp-exec');
  7. var $TypeError = TypeError;
  8. // `RegExpExec` abstract operation
  9. // https://tc39.es/ecma262/#sec-regexpexec
  10. module.exports = function (R, S) {
  11. var exec = R.exec;
  12. if (isCallable(exec)) {
  13. var result = call(exec, R, S);
  14. if (result !== null) anObject(result);
  15. return result;
  16. }
  17. if (classof(R) === 'RegExp') return call(regexpExec, R, S);
  18. throw new $TypeError('RegExp#exec called on incompatible receiver');
  19. };