| 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 913 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 924 str = TO_STRING_INLINE(str); | 924 str = TO_STRING_INLINE(str); |
| 925 if (str.length > 0) { | 925 if (str.length > 0) { |
| 926 var elements = this.elements; | 926 var elements = this.elements; |
| 927 elements[elements.length] = str; | 927 elements[elements.length] = str; |
| 928 } | 928 } |
| 929 } | 929 } |
| 930 | 930 |
| 931 | 931 |
| 932 ReplaceResultBuilder.prototype.addSpecialSlice = function(start, end) { | 932 ReplaceResultBuilder.prototype.addSpecialSlice = function(start, end) { |
| 933 var len = end - start; | 933 var len = end - start; |
| 934 if (len == 0) return; | 934 if (start < 0 || len <= 0) return; |
| 935 var elements = this.elements; | 935 var elements = this.elements; |
| 936 if (start < 0x80000 && len < 0x800) { | 936 if (start < 0x80000 && len < 0x800) { |
| 937 elements[elements.length] = (start << 11) + len; | 937 elements[elements.length] = (start << 11) | len; |
| 938 } else { | 938 } else { |
| 939 // 0 < len <= String::kMaxLength and Smi::kMaxValue >= String::kMaxLength, | 939 // 0 < len <= String::kMaxLength and Smi::kMaxValue >= String::kMaxLength, |
| 940 // so -len is a smi. | 940 // so -len is a smi. |
| 941 elements[elements.length] = -len; | 941 elements[elements.length] = -len; |
| 942 elements[elements.length] = start; | 942 elements[elements.length] = start; |
| 943 } | 943 } |
| 944 } | 944 } |
| 945 | 945 |
| 946 | 946 |
| 947 ReplaceResultBuilder.prototype.generate = function() { | 947 ReplaceResultBuilder.prototype.generate = function() { |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1004 "small", StringSmall, | 1004 "small", StringSmall, |
| 1005 "strike", StringStrike, | 1005 "strike", StringStrike, |
| 1006 "sub", StringSub, | 1006 "sub", StringSub, |
| 1007 "sup", StringSup, | 1007 "sup", StringSup, |
| 1008 "toJSON", StringToJSON | 1008 "toJSON", StringToJSON |
| 1009 )); | 1009 )); |
| 1010 } | 1010 } |
| 1011 | 1011 |
| 1012 | 1012 |
| 1013 SetupString(); | 1013 SetupString(); |
| OLD | NEW |