ChakraCore
ChakraCore copied to clipboard
[Bug]: Missing Implementation of String.prototype.replaceAll Method
ChakraCore Version
36becec
Steps to reproduce
When executing code containing the String.prototype.replaceAll method, a TypeError: Object doesn't support property or method 'replaceAll' occurs.
Proof of concept
var replaceWith = function (inputStr) {
return inputStr.replaceAll('a', 'b');
};
var originalStr = 'Y)a,K;aC&.';
var modifiedStr = replaceWith(originalStr);
print(modifiedStr);
Exception or Error
TypeError: Object doesn't support property or method 'replaceAll'
at replaceWith (/home/test.js:2:5)
at Global code (/home/test.js:5:1)
Additional Context
No response
@ayuan0828 , works perfectly fine when I use the same code in console. Please attach a screenshot on when you are facing the issues.
Here's a screenshot of my execution, and I'm very confused.
@ayuan0828 then its might be that originalStr is not a string but an object which is getting sent.
The function "matchAll" is the same case, maybe for the same reason?
@ayuan0828 Chakracore has never implemented matchAll or replace all, see https://github.com/chakra-core/ChakraCore/issues/6297 and https://github.com/chakra-core/ChakraCore/issues/6390
I think @Owaiseimdad may have been assuming this page is for bug reports for Edge? Edge stopped using chakracore some time ago, hence Microsoft discontinuing support of Chakracore.