| 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 // This file relies on the fact that the following declaration has been made | 5 // This file relies on the fact that the following declaration has been made |
| 6 // in runtime.js: | 6 // in runtime.js: |
| 7 // var $String = global.String; | 7 // var $String = global.String; |
| 8 | 8 |
| 9 // ------------------------------------------------------------------- | 9 // ------------------------------------------------------------------- |
| 10 | 10 |
| (...skipping 811 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 822 var code = %_Arguments(i); | 822 var code = %_Arguments(i); |
| 823 if (!%_IsSmi(code)) code = ToNumber(code) & 0xffff; | 823 if (!%_IsSmi(code)) code = ToNumber(code) & 0xffff; |
| 824 %_TwoByteSeqStringSetChar(two_byte, j, code); | 824 %_TwoByteSeqStringSetChar(two_byte, j, code); |
| 825 } | 825 } |
| 826 return one_byte + two_byte; | 826 return one_byte + two_byte; |
| 827 } | 827 } |
| 828 | 828 |
| 829 | 829 |
| 830 // ES6 draft, revision 26 (2014-07-18), section B.2.3.2.1 | 830 // ES6 draft, revision 26 (2014-07-18), section B.2.3.2.1 |
| 831 function HtmlEscape(str) { | 831 function HtmlEscape(str) { |
| 832 return TO_STRING_INLINE(str).replace(/</g, "<") | 832 return TO_STRING_INLINE(str).replace(/"/g, """); |
| 833 .replace(/>/g, ">") | |
| 834 .replace(/"/g, """) | |
| 835 .replace(/'/g, "'"); | |
| 836 } | 833 } |
| 837 | 834 |
| 838 | 835 |
| 839 // ES6 draft, revision 26 (2014-07-18), section B.2.3.2 | 836 // ES6 draft, revision 26 (2014-07-18), section B.2.3.2 |
| 840 function StringAnchor(name) { | 837 function StringAnchor(name) { |
| 841 CHECK_OBJECT_COERCIBLE(this, "String.prototype.anchor"); | 838 CHECK_OBJECT_COERCIBLE(this, "String.prototype.anchor"); |
| 842 return "<a name=\"" + HtmlEscape(name) + "\">" + this + "</a>"; | 839 return "<a name=\"" + HtmlEscape(name) + "\">" + this + "</a>"; |
| 843 } | 840 } |
| 844 | 841 |
| 845 | 842 |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 978 "fixed", StringFixed, | 975 "fixed", StringFixed, |
| 979 "italics", StringItalics, | 976 "italics", StringItalics, |
| 980 "small", StringSmall, | 977 "small", StringSmall, |
| 981 "strike", StringStrike, | 978 "strike", StringStrike, |
| 982 "sub", StringSub, | 979 "sub", StringSub, |
| 983 "sup", StringSup | 980 "sup", StringSup |
| 984 )); | 981 )); |
| 985 } | 982 } |
| 986 | 983 |
| 987 SetUpString(); | 984 SetUpString(); |
| OLD | NEW |