OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 (function(global, utils) { | 5 (function(global, utils) { |
6 | 6 |
7 'use strict'; | 7 'use strict'; |
8 | 8 |
9 %CheckIsBootstrapping(); | 9 %CheckIsBootstrapping(); |
10 | 10 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 %IncrementUseCounter(kRegExpPrototypeStickyGetter); | 49 %IncrementUseCounter(kRegExpPrototypeStickyGetter); |
50 return UNDEFINED; | 50 return UNDEFINED; |
51 } | 51 } |
52 throw MakeTypeError(kRegExpNonRegExp, "RegExp.prototype.sticky"); | 52 throw MakeTypeError(kRegExpNonRegExp, "RegExp.prototype.sticky"); |
53 } | 53 } |
54 return !!REGEXP_STICKY(this); | 54 return !!REGEXP_STICKY(this); |
55 } | 55 } |
56 %FunctionSetName(RegExpGetSticky, "RegExp.prototype.sticky"); | 56 %FunctionSetName(RegExpGetSticky, "RegExp.prototype.sticky"); |
57 %SetNativeFlag(RegExpGetSticky); | 57 %SetNativeFlag(RegExpGetSticky); |
58 | 58 |
59 | |
60 // ES6 21.2.5.15. | |
61 function RegExpGetUnicode() { | |
62 if (!IS_REGEXP(this)) { | |
63 throw MakeTypeError(kRegExpNonRegExp, "RegExp.prototype.unicode"); | |
64 } | |
65 return !!REGEXP_UNICODE(this); | |
66 } | |
67 %FunctionSetName(RegExpGetUnicode, "RegExp.prototype.unicode"); | |
68 %SetNativeFlag(RegExpGetUnicode); | |
69 | |
70 utils.InstallGetter(GlobalRegExp.prototype, 'flags', RegExpGetFlags); | 59 utils.InstallGetter(GlobalRegExp.prototype, 'flags', RegExpGetFlags); |
71 utils.InstallGetter(GlobalRegExp.prototype, 'sticky', RegExpGetSticky); | 60 utils.InstallGetter(GlobalRegExp.prototype, 'sticky', RegExpGetSticky); |
72 utils.InstallGetter(GlobalRegExp.prototype, 'unicode', RegExpGetUnicode); | |
73 | 61 |
74 }) | 62 }) |
OLD | NEW |