Skip to content

Commit b5b9e03

Browse files
robhoganfacebook-github-bot
authored andcommitted
Fix Android JSC compatibility - replaceAll -> replace (#48076)
Summary: Pull Request resolved: #48076 JSC for Android does not implement `String.prototype.replaceAll`: {F1971791988} #47466 introduced a use of it into runtime code, breaking JSC compatibility. This.. replaces it.. with `replace`. Since the argument is already a regex with a `g` modifier, `replaceAll` wasn't necessary anyway. Changelog: [ANDROID][FIXED] Fix JSC by avoiding use of unavailable `str.replaceAll()` Reviewed By: javache Differential Revision: D66712312 fbshipit-source-id: 534b6db6834a2fda46ae8457437de3caa24f4eb0
1 parent 4c62d46 commit b5b9e03

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: packages/polyfills/console.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,7 @@ if (global.nativeLoggingHook) {
559559
let originalConsoleError = console.error;
560560
console.reportErrorsAsExceptions = true;
561561
function stringifySafe(arg) {
562-
return inspect(arg, {depth: 10}).replaceAll(/\n\s*/g, ' ');
562+
return inspect(arg, {depth: 10}).replace(/\n\s*/g, ' ');
563563
}
564564
console.error = function (...args) {
565565
originalConsoleError.apply(this, args);

0 commit comments

Comments
 (0)