| OLD | NEW |
| 1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 894 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 905 str = TO_STRING_INLINE(str); | 905 str = TO_STRING_INLINE(str); |
| 906 if (str.length > 0) { | 906 if (str.length > 0) { |
| 907 var elements = this.elements; | 907 var elements = this.elements; |
| 908 elements[elements.length] = str; | 908 elements[elements.length] = str; |
| 909 } | 909 } |
| 910 } | 910 } |
| 911 | 911 |
| 912 | 912 |
| 913 ReplaceResultBuilder.prototype.addSpecialSlice = function(start, end) { | 913 ReplaceResultBuilder.prototype.addSpecialSlice = function(start, end) { |
| 914 var len = end - start; | 914 var len = end - start; |
| 915 if (len == 0) return; | 915 if (start < 0 || len <= 0) return; |
| 916 var elements = this.elements; | 916 var elements = this.elements; |
| 917 if (start < 0x80000 && len < 0x800) { | 917 if (start < 0x80000 && len < 0x800) { |
| 918 elements[elements.length] = (start << 11) + len; | 918 elements[elements.length] = (start << 11) | len; |
| 919 } else { | 919 } else { |
| 920 // 0 < len <= String::kMaxLength and Smi::kMaxValue >= String::kMaxLength, | 920 // 0 < len <= String::kMaxLength and Smi::kMaxValue >= String::kMaxLength, |
| 921 // so -len is a smi. | 921 // so -len is a smi. |
| 922 elements[elements.length] = -len; | 922 elements[elements.length] = -len; |
| 923 elements[elements.length] = start; | 923 elements[elements.length] = start; |
| 924 } | 924 } |
| 925 } | 925 } |
| 926 | 926 |
| 927 | 927 |
| 928 ReplaceResultBuilder.prototype.generate = function() { | 928 ReplaceResultBuilder.prototype.generate = function() { |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 985 "small", StringSmall, | 985 "small", StringSmall, |
| 986 "strike", StringStrike, | 986 "strike", StringStrike, |
| 987 "sub", StringSub, | 987 "sub", StringSub, |
| 988 "sup", StringSup, | 988 "sup", StringSup, |
| 989 "toJSON", StringToJSON | 989 "toJSON", StringToJSON |
| 990 )); | 990 )); |
| 991 } | 991 } |
| 992 | 992 |
| 993 | 993 |
| 994 SetupString(); | 994 SetupString(); |
| OLD | NEW |