Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(633)

Unified Diff: src/string.js

Issue 422543003: Add `CheckObjectCoercible` for the `String.prototype` HTML methods (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/mjsunit/string-html.js » ('j') | test/mjsunit/string-html.js » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/string.js
diff --git a/src/string.js b/src/string.js
index 0d5ed0fc4297c49b0f79917de5a9e6b6a2758c4d..09564d00593ba41f53c782071edd0c9c1c304e4b 100644
--- a/src/string.js
+++ b/src/string.js
@@ -839,66 +839,79 @@ function HtmlEscape(str) {
// Compatibility support for KJS.
// Tested by mozilla/js/tests/js1_5/Regress/regress-276103.js.
function StringLink(s) {
+ CHECK_OBJECT_COERCIBLE(this, "String.prototype.link");
Yang 2014/08/05 10:34:19 Now that all of this is specified in ES6, do you m
return "<a href=\"" + HtmlEscape(s) + "\">" + this + "</a>";
}
function StringAnchor(name) {
+ CHECK_OBJECT_COERCIBLE(this, "String.prototype.anchor");
return "<a name=\"" + HtmlEscape(name) + "\">" + this + "</a>";
}
function StringFontcolor(color) {
+ CHECK_OBJECT_COERCIBLE(this, "String.prototype.fontcolor");
return "<font color=\"" + HtmlEscape(color) + "\">" + this + "</font>";
}
function StringFontsize(size) {
+ CHECK_OBJECT_COERCIBLE(this, "String.prototype.fontsize");
return "<font size=\"" + HtmlEscape(size) + "\">" + this + "</font>";
}
function StringBig() {
+ CHECK_OBJECT_COERCIBLE(this, "String.prototype.big");
return "<big>" + this + "</big>";
}
function StringBlink() {
+ CHECK_OBJECT_COERCIBLE(this, "String.prototype.blink");
return "<blink>" + this + "</blink>";
}
function StringBold() {
+ CHECK_OBJECT_COERCIBLE(this, "String.prototype.bold");
return "<b>" + this + "</b>";
}
function StringFixed() {
+ CHECK_OBJECT_COERCIBLE(this, "String.prototype.fixed");
return "<tt>" + this + "</tt>";
}
function StringItalics() {
+ CHECK_OBJECT_COERCIBLE(this, "String.prototype.italics");
return "<i>" + this + "</i>";
}
function StringSmall() {
+ CHECK_OBJECT_COERCIBLE(this, "String.prototype.small");
return "<small>" + this + "</small>";
}
function StringStrike() {
+ CHECK_OBJECT_COERCIBLE(this, "String.prototype.strike");
return "<strike>" + this + "</strike>";
}
function StringSub() {
+ CHECK_OBJECT_COERCIBLE(this, "String.prototype.sub");
return "<sub>" + this + "</sub>";
}
function StringSup() {
+ CHECK_OBJECT_COERCIBLE(this, "String.prototype.sup");
return "<sup>" + this + "</sup>";
}
« no previous file with comments | « no previous file | test/mjsunit/string-html.js » ('j') | test/mjsunit/string-html.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698