|
@@ -95,6 +95,9 @@ namespace Jint.Native.RegExp
|
|
|
SetSymbols(symbols);
|
|
|
}
|
|
|
|
|
|
+ /// <summary>
|
|
|
+ /// https://tc39.es/ecma262/#sec-get-regexp.prototype.source
|
|
|
+ /// </summary>
|
|
|
private JsValue Source(JsValue thisObj, JsValue[] arguments)
|
|
|
{
|
|
|
if (ReferenceEquals(thisObj, this))
|
|
@@ -108,6 +111,11 @@ namespace Jint.Native.RegExp
|
|
|
ExceptionHelper.ThrowTypeError(_realm);
|
|
|
}
|
|
|
|
|
|
+ if (r.Source is null)
|
|
|
+ {
|
|
|
+ return JsString.Empty;
|
|
|
+ }
|
|
|
+
|
|
|
return r.Source.Replace("/", "\\/");
|
|
|
}
|
|
|
|