| 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 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 // ECMA-262, 15.5.4.19 | 326 // ECMA-262, 15.5.4.19 |
| 327 function StringToLocaleUpperCase() { | 327 function StringToLocaleUpperCase() { |
| 328 CHECK_OBJECT_COERCIBLE(this, "String.prototype.toLocaleUpperCase"); | 328 CHECK_OBJECT_COERCIBLE(this, "String.prototype.toLocaleUpperCase"); |
| 329 | 329 |
| 330 return %StringToUpperCase(TO_STRING(this)); | 330 return %StringToUpperCase(TO_STRING(this)); |
| 331 } | 331 } |
| 332 | 332 |
| 333 | 333 |
| 334 // ES6 draft, revision 26 (2014-07-18), section B.2.3.2.1 | 334 // ES6 draft, revision 26 (2014-07-18), section B.2.3.2.1 |
| 335 function HtmlEscape(str) { | 335 function HtmlEscape(str) { |
| 336 return %_Call(StringReplace, TO_STRING(str), /"/g, """); | 336 return %RegExpInternalReplace(/"/g, TO_STRING(str), """); |
| 337 } | 337 } |
| 338 | 338 |
| 339 | 339 |
| 340 // ES6 draft, revision 26 (2014-07-18), section B.2.3.2 | 340 // ES6 draft, revision 26 (2014-07-18), section B.2.3.2 |
| 341 function StringAnchor(name) { | 341 function StringAnchor(name) { |
| 342 CHECK_OBJECT_COERCIBLE(this, "String.prototype.anchor"); | 342 CHECK_OBJECT_COERCIBLE(this, "String.prototype.anchor"); |
| 343 return "<a name=\"" + HtmlEscape(name) + "\">" + TO_STRING(this) + | 343 return "<a name=\"" + HtmlEscape(name) + "\">" + TO_STRING(this) + |
| 344 "</a>"; | 344 "</a>"; |
| 345 } | 345 } |
| 346 | 346 |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 543 // Exports | 543 // Exports |
| 544 | 544 |
| 545 utils.Export(function(to) { | 545 utils.Export(function(to) { |
| 546 to.StringMatch = StringMatchJS; | 546 to.StringMatch = StringMatchJS; |
| 547 to.StringReplace = StringReplace; | 547 to.StringReplace = StringReplace; |
| 548 to.StringSlice = StringSlice; | 548 to.StringSlice = StringSlice; |
| 549 to.StringSplit = StringSplitJS; | 549 to.StringSplit = StringSplitJS; |
| 550 }); | 550 }); |
| 551 | 551 |
| 552 }) | 552 }) |
| OLD | NEW |