Index: src/regexp.js |
diff --git a/src/regexp.js b/src/regexp.js |
index e1eac76c124dbda3bc0635466617d1887fd17775..bade7aadd29240880f576cc75ae7b4797013bda5 100644 |
--- a/src/regexp.js |
+++ b/src/regexp.js |
@@ -431,6 +431,29 @@ function SetUpRegExp() { |
DONT_DELETE); |
} |
%ToFastProperties($RegExp); |
+ |
+ |
+ // ES6 draft 12-06-13, section 21.2.5.3 |
+ // + https://bugs.ecmascript.org/show_bug.cgi?id=3423 |
+ var RegExpGetFlags = function() { |
+ if (!IS_SPEC_OBJECT(this)) { |
+ throw MakeTypeError('home_object_non_object', |
+ 'RegExp.prototype.flags', |
+ [%ToString(this)]); |
+ } |
+ var result = ''; |
+ if (this.global) result += 'g'; |
+ if (this.ignoreCase) result += 'i'; |
+ if (this.multiline) result += 'm'; |
+ if (this.unicode) result += 'u'; |
+ if (this.sticky) result += 'y'; |
+ return result; |
+ }; |
+ //if (harmony_regexps) { |
Dmitry Lomov (no reviews)
2014/12/09 23:02:00
harmony_regexps should not be used in bootstrappin
|
+ %DefineAccessorPropertyUnchecked($RegExp.prototype, 'flags', RegExpGetFlags, |
+ NoOpSetter, DONT_DELETE); |
+ %SetNativeFlag(RegExpGetFlags); |
+ //} |
mathias
2014/12/09 22:50:48
Uncommenting the `if` statement breaks the build.
|
} |
SetUpRegExp(); |