Index: src/js/regexp.js |
diff --git a/src/js/regexp.js b/src/js/regexp.js |
index d358ce06b55d6070eef78b9d4f1224630db8fc84..086f5e5c5e62b466e8ccf81653a6d4ed76979816 100644 |
--- a/src/js/regexp.js |
+++ b/src/js/regexp.js |
@@ -270,17 +270,8 @@ |
} |
-const kRegExpPrototypeToString = 12; |
- |
function RegExpToString() { |
if (!IS_REGEXP(this)) { |
- // RegExp.prototype.toString() returns '/(?:)/' as a compatibility fix; |
- // a UseCounter is incremented to track it. |
- // TODO(littledan): Remove this workaround or standardize it |
- if (this === GlobalRegExpPrototype) { |
- %IncrementUseCounter(kRegExpPrototypeToString); |
- return '/(?:)/'; |
- } |
throw MakeTypeError(kIncompatibleMethodReceiver, |
'RegExp.prototype.toString', this); |
} |
@@ -500,8 +491,7 @@ |
// ------------------------------------------------------------------- |
%FunctionSetInstanceClassName(GlobalRegExp, 'RegExp'); |
-const GlobalRegExpPrototype = new GlobalObject(); |
-%FunctionSetPrototype(GlobalRegExp, GlobalRegExpPrototype); |
+%FunctionSetPrototype(GlobalRegExp, new GlobalObject()); |
%AddNamedProperty( |
GlobalRegExp.prototype, 'constructor', GlobalRegExp, DONT_ENUM); |
%SetCode(GlobalRegExp, RegExpConstructor); |