@@ -35,13 +35,14 @@ const {
3535 ObjectKeys,
3636 ObjectPrototypeIsPrototypeOf,
3737 ReflectApply,
38+ RegExpPrototypeSymbolReplace,
3839 RegExpPrototypeTest,
3940 SafeMap,
4041 String,
4142 StringPrototypeCharCodeAt,
4243 StringPrototypeIncludes,
4344 StringPrototypeIndexOf,
44- StringPrototypeReplace ,
45+ StringPrototypeReplaceAll ,
4546 StringPrototypeSlice,
4647 StringPrototypeSplit,
4748 StringPrototypeStartsWith,
@@ -271,9 +272,10 @@ function parseCode(code, offset) {
271272
272273 return [
273274 node . node . start ,
274- StringPrototypeReplace ( StringPrototypeSlice ( code ,
275- node . node . start , node . node . end ) ,
276- escapeSequencesRegExp , escapeFn )
275+ RegExpPrototypeSymbolReplace (
276+ escapeSequencesRegExp ,
277+ StringPrototypeSlice ( code , node . node . start , node . node . end ) ,
278+ escapeFn )
277279 ] ;
278280}
279281
@@ -345,7 +347,7 @@ function getErrMessage(message, fn) {
345347 // Always normalize indentation, otherwise the message could look weird.
346348 if ( StringPrototypeIncludes ( message , '\n' ) ) {
347349 if ( EOL === '\r\n' ) {
348- message = StringPrototypeReplace ( message , / \r \n / g , '\n' ) ;
350+ message = StringPrototypeReplaceAll ( message , ' \r\n' , '\n' ) ;
349351 }
350352 const frames = StringPrototypeSplit ( message , '\n' ) ;
351353 message = ArrayPrototypeShift ( frames ) ;
0 commit comments