blob: 6a178250c107330c175ad0de5a58ace2269bb400 [file] [log] [blame]
function shouldBe(actual, expected) {
if (actual !== expected)
throw new Error(`bad value: ${String(actual)}`);
}
var regexp = Object.create(null);
regexp.reg = /Hello/;
regexp.exec = function (value) {
return regexp.reg.exec(value);
};
var string = "Hello";
shouldBe(RegExp.prototype[Symbol.replace].call(regexp, string, "OK"), "OK")