1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 (function(global, utils) {
9 %CheckIsBootstrapping();
11 // -------------------------------------------------------------------
14 var GlobalRegExp = global.RegExp;
17 utils.Import(function(from) {
18 ToString = from.ToString;
21 // -------------------------------------------------------------------
23 // ES6 draft 12-06-13, section 21.2.5.3
24 // + https://bugs.ecmascript.org/show_bug.cgi?id=3423
25 function RegExpGetFlags() {
26 if (!IS_SPEC_OBJECT(this)) {
27 throw MakeTypeError(kFlagsGetterNonObject, ToString(this));
30 if (this.global) result += 'g';
31 if (this.ignoreCase) result += 'i';
32 if (this.multiline) result += 'm';
33 if (this.unicode) result += 'u';
34 if (this.sticky) result += 'y';
38 %DefineAccessorPropertyUnchecked(GlobalRegExp.prototype, 'flags',
39 RegExpGetFlags, null, DONT_ENUM);
40 %SetNativeFlag(RegExpGetFlags);