Index: src/js/harmony-unicode-regexps.js |
diff --git a/src/js/harmony-unicode-regexps.js b/src/js/harmony-unicode-regexps.js |
index a43939574cc8f9d1da19103f40b882602b3aeda9..83228fc6cb0a2e45506f698d7e3cf431a3dc400e 100644 |
--- a/src/js/harmony-unicode-regexps.js |
+++ b/src/js/harmony-unicode-regexps.js |
@@ -15,6 +15,8 @@ var GlobalRegExp = global.RegExp; |
var GlobalRegExpPrototype = GlobalRegExp.prototype; |
var MakeTypeError; |
+const kRegExpPrototypeUnicodeGetter = 11; |
adamk
2016/01/05 19:10:09
Hmm, it seems like only one other place (harmony-r
Dan Ehrenberg
2016/01/06 03:20:54
Alright, used macros instead.
|
+ |
utils.Import(function(from) { |
MakeTypeError = from.MakeTypeError; |
}); |
@@ -24,6 +26,9 @@ utils.Import(function(from) { |
// ES6 21.2.5.15. |
function RegExpGetUnicode() { |
if (!IS_REGEXP(this)) { |
+ if (this === GlobalRegExpPrototype) { |
+ %IncrementUseCounter(kRegExpPrototypeUnicodeGetter); |
+ } |
throw MakeTypeError(kRegExpNonRegExp, "RegExp.prototype.unicode"); |
} |
return !!REGEXP_UNICODE(this); |