| 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 828 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 839 var code = %_Arguments(i); | 839 var code = %_Arguments(i); |
| 840 if (!%_IsSmi(code)) code = $toNumber(code) & 0xffff; | 840 if (!%_IsSmi(code)) code = $toNumber(code) & 0xffff; |
| 841 %_TwoByteSeqStringSetChar(j, code, two_byte); | 841 %_TwoByteSeqStringSetChar(j, code, two_byte); |
| 842 } | 842 } |
| 843 return one_byte + two_byte; | 843 return one_byte + two_byte; |
| 844 } | 844 } |
| 845 | 845 |
| 846 | 846 |
| 847 // ES6 draft, revision 26 (2014-07-18), section B.2.3.2.1 | 847 // ES6 draft, revision 26 (2014-07-18), section B.2.3.2.1 |
| 848 function HtmlEscape(str) { | 848 function HtmlEscape(str) { |
| 849 return TO_STRING_INLINE(str).replace(/"/g, """); | 849 return %_CallFunction(TO_STRING_INLINE(str), /"/g, """, StringReplace); |
| 850 } | 850 } |
| 851 | 851 |
| 852 | 852 |
| 853 // ES6 draft, revision 26 (2014-07-18), section B.2.3.2 | 853 // ES6 draft, revision 26 (2014-07-18), section B.2.3.2 |
| 854 function StringAnchor(name) { | 854 function StringAnchor(name) { |
| 855 CHECK_OBJECT_COERCIBLE(this, "String.prototype.anchor"); | 855 CHECK_OBJECT_COERCIBLE(this, "String.prototype.anchor"); |
| 856 return "<a name=\"" + HtmlEscape(name) + "\">" + TO_STRING_INLINE(this) + | 856 return "<a name=\"" + HtmlEscape(name) + "\">" + TO_STRING_INLINE(this) + |
| 857 "</a>"; | 857 "</a>"; |
| 858 } | 858 } |
| 859 | 859 |
| (...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1188 // ------------------------------------------------------------------- | 1188 // ------------------------------------------------------------------- |
| 1189 // Exports | 1189 // Exports |
| 1190 | 1190 |
| 1191 utils.Export(function(to) { | 1191 utils.Export(function(to) { |
| 1192 to.StringCharAt = StringCharAtJS; | 1192 to.StringCharAt = StringCharAtJS; |
| 1193 to.StringIndexOf = StringIndexOfJS; | 1193 to.StringIndexOf = StringIndexOfJS; |
| 1194 to.StringSubstring = StringSubstring; | 1194 to.StringSubstring = StringSubstring; |
| 1195 }); | 1195 }); |
| 1196 | 1196 |
| 1197 }) | 1197 }) |
| OLD | NEW |