| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 794 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 805 StringBuilder.prototype.generate = function() { | 805 StringBuilder.prototype.generate = function() { |
| 806 return %StringBuilderConcat(this.elements, ""); | 806 return %StringBuilderConcat(this.elements, ""); |
| 807 } | 807 } |
| 808 | 808 |
| 809 | 809 |
| 810 ReplaceResultBuilder.prototype.generate = function() { | 810 ReplaceResultBuilder.prototype.generate = function() { |
| 811 return %StringBuilderConcat(this.elements, this.special_string); | 811 return %StringBuilderConcat(this.elements, this.special_string); |
| 812 } | 812 } |
| 813 | 813 |
| 814 | 814 |
| 815 function StringToJSON(key) { |
| 816 return CheckJSONPrimitive(this.valueOf()); |
| 817 } |
| 818 |
| 819 |
| 815 // ------------------------------------------------------------------- | 820 // ------------------------------------------------------------------- |
| 816 | 821 |
| 817 function SetupString() { | 822 function SetupString() { |
| 818 // Setup the constructor property on the String prototype object. | 823 // Setup the constructor property on the String prototype object. |
| 819 %SetProperty($String.prototype, "constructor", $String, DONT_ENUM); | 824 %SetProperty($String.prototype, "constructor", $String, DONT_ENUM); |
| 820 | 825 |
| 821 | 826 |
| 822 // Setup the non-enumerable functions on the String object. | 827 // Setup the non-enumerable functions on the String object. |
| 823 InstallFunctions($String, DONT_ENUM, $Array( | 828 InstallFunctions($String, DONT_ENUM, $Array( |
| 824 "fromCharCode", StringFromCharCode | 829 "fromCharCode", StringFromCharCode |
| (...skipping 26 matching lines...) Expand all Loading... |
| 851 "fontcolor", StringFontcolor, | 856 "fontcolor", StringFontcolor, |
| 852 "fontsize", StringFontsize, | 857 "fontsize", StringFontsize, |
| 853 "big", StringBig, | 858 "big", StringBig, |
| 854 "blink", StringBlink, | 859 "blink", StringBlink, |
| 855 "bold", StringBold, | 860 "bold", StringBold, |
| 856 "fixed", StringFixed, | 861 "fixed", StringFixed, |
| 857 "italics", StringItalics, | 862 "italics", StringItalics, |
| 858 "small", StringSmall, | 863 "small", StringSmall, |
| 859 "strike", StringStrike, | 864 "strike", StringStrike, |
| 860 "sub", StringSub, | 865 "sub", StringSub, |
| 861 "sup", StringSup | 866 "sup", StringSup, |
| 867 "toJSON", StringToJSON |
| 862 )); | 868 )); |
| 863 } | 869 } |
| 864 | 870 |
| 865 | 871 |
| 866 SetupString(); | 872 SetupString(); |
| OLD | NEW |