@@ -35,7 +35,8 @@ const {
3535 ObjectKeys,
3636 ObjectPrototypeIsPrototypeOf,
3737 ReflectApply,
38- RegExpPrototypeTest,
38+ RegExpPrototypeExec,
39+ RegExpPrototypeSymbolReplace,
3940 SafeMap,
4041 String,
4142 StringPrototypeCharCodeAt,
@@ -345,7 +346,7 @@ function getErrMessage(message, fn) {
345346 // Always normalize indentation, otherwise the message could look weird.
346347 if ( StringPrototypeIncludes ( message , '\n' ) ) {
347348 if ( EOL === '\r\n' ) {
348- message = StringPrototypeReplace ( message , / \r \n / g, '\n' ) ;
349+ message = RegExpPrototypeSymbolReplace ( / \r \n / g, message , '\n' ) ;
349350 }
350351 const frames = StringPrototypeSplit ( message , '\n' ) ;
351352 message = ArrayPrototypeShift ( frames ) ;
@@ -606,7 +607,7 @@ class Comparison {
606607 if ( actual !== undefined &&
607608 typeof actual [ key ] === 'string' &&
608609 isRegExp ( obj [ key ] ) &&
609- RegExpPrototypeTest ( obj [ key ] , actual [ key ] ) ) {
610+ RegExpPrototypeExec ( obj [ key ] , actual [ key ] ) !== null ) {
610611 this [ key ] = actual [ key ] ;
611612 } else {
612613 this [ key ] = obj [ key ] ;
@@ -652,7 +653,7 @@ function expectedException(actual, expected, message, fn) {
652653 // Handle regular expressions.
653654 if ( isRegExp ( expected ) ) {
654655 const str = String ( actual ) ;
655- if ( RegExpPrototypeTest ( expected , str ) )
656+ if ( RegExpPrototypeExec ( expected , str ) !== null )
656657 return ;
657658
658659 if ( ! message ) {
@@ -687,7 +688,7 @@ function expectedException(actual, expected, message, fn) {
687688 for ( const key of keys ) {
688689 if ( typeof actual [ key ] === 'string' &&
689690 isRegExp ( expected [ key ] ) &&
690- RegExpPrototypeTest ( expected [ key ] , actual [ key ] ) ) {
691+ RegExpPrototypeExec ( expected [ key ] , actual [ key ] ) !== null ) {
691692 continue ;
692693 }
693694 compareExceptionKey ( actual , expected , key , message , keys , fn ) ;
@@ -851,7 +852,7 @@ function hasMatchingError(actual, expected) {
851852 if ( typeof expected !== 'function' ) {
852853 if ( isRegExp ( expected ) ) {
853854 const str = String ( actual ) ;
854- return RegExpPrototypeTest ( expected , str ) ;
855+ return RegExpPrototypeExec ( expected , str ) !== null ;
855856 }
856857 throw new ERR_INVALID_ARG_TYPE (
857858 'expected' , [ 'Function' , 'RegExp' ] , expected
@@ -1000,7 +1001,7 @@ function internalMatch(string, regexp, message, fn) {
10001001 }
10011002 const match = fn === assert . match ;
10021003 if ( typeof string !== 'string' ||
1003- RegExpPrototypeTest ( regexp , string ) !== match ) {
1004+ RegExpPrototypeExec ( regexp , string ) !== null !== match ) {
10041005 if ( message instanceof Error ) {
10051006 throw message ;
10061007 }
0 commit comments