| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 var $regexpLastMatchInfoOverride; | 5 var $regexpLastMatchInfoOverride; |
| 6 | 6 |
| 7 (function(global, utils) { | 7 (function(global, utils) { |
| 8 | 8 |
| 9 %CheckIsBootstrapping(); | 9 %CheckIsBootstrapping(); |
| 10 | 10 |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 } | 136 } |
| 137 return result; | 137 return result; |
| 138 endmacro | 138 endmacro |
| 139 | 139 |
| 140 | 140 |
| 141 function RegExpExecNoTests(regexp, string, start) { | 141 function RegExpExecNoTests(regexp, string, start) { |
| 142 // Must be called with RegExp, string and positive integer as arguments. | 142 // Must be called with RegExp, string and positive integer as arguments. |
| 143 var matchInfo = %_RegExpExec(regexp, string, start, RegExpLastMatchInfo); | 143 var matchInfo = %_RegExpExec(regexp, string, start, RegExpLastMatchInfo); |
| 144 if (matchInfo !== null) { | 144 if (matchInfo !== null) { |
| 145 $regexpLastMatchInfoOverride = null; | 145 $regexpLastMatchInfoOverride = null; |
| 146 // ES6 21.2.5.2.2 step 18. |
| 147 if (FLAG_harmony_regexps && regexp.sticky) { |
| 148 regexp.lastIndex = matchInfo[CAPTURE1]; |
| 149 } |
| 146 RETURN_NEW_RESULT_FROM_MATCH_INFO(matchInfo, string); | 150 RETURN_NEW_RESULT_FROM_MATCH_INFO(matchInfo, string); |
| 147 } | 151 } |
| 148 regexp.lastIndex = 0; | 152 regexp.lastIndex = 0; |
| 149 return null; | 153 return null; |
| 150 } | 154 } |
| 151 | 155 |
| 152 | 156 |
| 153 function RegExpExecJS(string) { | 157 function RegExpExecJS(string) { |
| 154 if (!IS_REGEXP(this)) { | 158 if (!IS_REGEXP(this)) { |
| 155 throw MakeTypeError(kIncompatibleMethodReceiver, | 159 throw MakeTypeError(kIncompatibleMethodReceiver, |
| (...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 449 // Exports | 453 // Exports |
| 450 | 454 |
| 451 utils.Export(function(to) { | 455 utils.Export(function(to) { |
| 452 to.RegExpExec = DoRegExpExec; | 456 to.RegExpExec = DoRegExpExec; |
| 453 to.RegExpExecNoTests = RegExpExecNoTests; | 457 to.RegExpExecNoTests = RegExpExecNoTests; |
| 454 to.RegExpLastMatchInfo = RegExpLastMatchInfo; | 458 to.RegExpLastMatchInfo = RegExpLastMatchInfo; |
| 455 to.RegExpTest = RegExpTest; | 459 to.RegExpTest = RegExpTest; |
| 456 }); | 460 }); |
| 457 | 461 |
| 458 }) | 462 }) |
| OLD | NEW |