| 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 (function(global, utils) { | 5 (function(global, utils) { |
| 6 | 6 |
| 7 %CheckIsBootstrapping(); | 7 %CheckIsBootstrapping(); |
| 8 | 8 |
| 9 // ------------------------------------------------------------------- | 9 // ------------------------------------------------------------------- |
| 10 // Imports | 10 // Imports |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 } | 289 } |
| 290 return '/' + TO_STRING(this.source) + '/' + TO_STRING(this.flags); | 290 return '/' + TO_STRING(this.source) + '/' + TO_STRING(this.flags); |
| 291 } | 291 } |
| 292 | 292 |
| 293 | 293 |
| 294 function AtSurrogatePair(subject, index) { | 294 function AtSurrogatePair(subject, index) { |
| 295 if (index + 1 >= subject.length) return false; | 295 if (index + 1 >= subject.length) return false; |
| 296 var first = %_StringCharCodeAt(subject, index); | 296 var first = %_StringCharCodeAt(subject, index); |
| 297 if (first < 0xD800 || first > 0xDBFF) return false; | 297 if (first < 0xD800 || first > 0xDBFF) return false; |
| 298 var second = %_StringCharCodeAt(subject, index + 1); | 298 var second = %_StringCharCodeAt(subject, index + 1); |
| 299 return second >= 0xDC00 || second <= 0xDFFF; | 299 return second >= 0xDC00 && second <= 0xDFFF; |
| 300 } | 300 } |
| 301 | 301 |
| 302 | 302 |
| 303 // Fast path implementation of RegExp.prototype[Symbol.split] which | 303 // Fast path implementation of RegExp.prototype[Symbol.split] which |
| 304 // doesn't properly call the underlying exec, @@species methods | 304 // doesn't properly call the underlying exec, @@species methods |
| 305 function RegExpSplit(string, limit) { | 305 function RegExpSplit(string, limit) { |
| 306 if (!IS_REGEXP(this)) { | 306 if (!IS_REGEXP(this)) { |
| 307 throw %make_type_error(kIncompatibleMethodReceiver, | 307 throw %make_type_error(kIncompatibleMethodReceiver, |
| 308 "RegExp.prototype.@@split", this); | 308 "RegExp.prototype.@@split", this); |
| 309 } | 309 } |
| (...skipping 827 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1137 utils.Export(function(to) { | 1137 utils.Export(function(to) { |
| 1138 to.InternalRegExpMatch = InternalRegExpMatch; | 1138 to.InternalRegExpMatch = InternalRegExpMatch; |
| 1139 to.InternalRegExpReplace = InternalRegExpReplace; | 1139 to.InternalRegExpReplace = InternalRegExpReplace; |
| 1140 to.IsRegExp = IsRegExp; | 1140 to.IsRegExp = IsRegExp; |
| 1141 to.RegExpExec = DoRegExpExec; | 1141 to.RegExpExec = DoRegExpExec; |
| 1142 to.RegExpInitialize = RegExpInitialize; | 1142 to.RegExpInitialize = RegExpInitialize; |
| 1143 to.RegExpLastMatchInfo = RegExpLastMatchInfo; | 1143 to.RegExpLastMatchInfo = RegExpLastMatchInfo; |
| 1144 }); | 1144 }); |
| 1145 | 1145 |
| 1146 }) | 1146 }) |
| OLD | NEW |