Reviewers: adamk, littledan,
Message:
On 2015/06/22 19:40:02, commit-bot: I haz the power wrote:
Try jobs failed on following builders:
linux_blink_rel on tryserver.blink (JOB_FAILED,
http://build.chromium.org/p/tryserver.blink/builders/linux_blink_rel/builds/67943)
Needs git rebase
Description:
Fix HTML string methods to not depend on replace method
Before this we were using String.prototype.replace. Now
we call the internal StringReplace instead.
BUG=v8:4221
LOG=N
R=adamk, littledan
CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:linux_chromium_rel_ng;tryserver.blink:linux_blink_rel
Please review this at https://codereview.chromium.org/1199933005/
Base URL: https://chromium.googlesource.com/v8/v8.git@master
Affected files (+8, -1 lines):
M src/string.js
M test/mjsunit/es6/string-html.js
Index: src/string.js
diff --git a/src/string.js b/src/string.js
index
9798846dc7be3e8e74012fa8be23e259857a162d..a773a9073175299f05e643cd48e6ef60ea2b82ee
100644
--- a/src/string.js
+++ b/src/string.js
@@ -846,7 +846,7 @@ function StringFromCharCode(code) {
// ES6 draft, revision 26 (2014-07-18), section B.2.3.2.1
function HtmlEscape(str) {
- return TO_STRING_INLINE(str).replace(/"/g, """);
+ return %_CallFunction(TO_STRING_INLINE(str), /"/g, """,
StringReplace);
}
Index: test/mjsunit/es6/string-html.js
diff --git a/test/mjsunit/es6/string-html.js
b/test/mjsunit/es6/string-html.js
index
4f3feb56dd1f5e7e10b1f3f9a5e153b450b84f15..464a6ef29d4f6ba77e26ead4014000edb65eaac1
100644
--- a/test/mjsunit/es6/string-html.js
+++ b/test/mjsunit/es6/string-html.js
@@ -157,3 +157,10 @@ assertThrows(function() {
String.prototype.sup.call(null);
}, TypeError);
assertEquals(String.prototype.sup.length, 0);
+
+
+(function TestDeleteStringRelace() {
+ assertEquals('<a name="n">s</a>', 's'.anchor('n'));
+ assertTrue(delete String.prototype.replace);
+ assertEquals('<a name="n">s</a>', 's'.anchor('n'));
+})();
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.