Status: New
Owner: ----

New issue 2218 by [email protected]: HTML extensions to String.prototype must throw an error if the `this` object is not coercible (i.e. `null` or `undefined`)
http://code.google.com/p/v8/issues/detail?id=2218

Spec: http://mathias.html5.org/specs/javascript/#string

Note that the first step of all these methods is:

1. Call CheckObjectCoercible(this).

V8 doesn’t currently perform this step. For example:

String.prototype.anchor.call(undefined); // should throw a TypeError, but doesn’t in V8 String.prototype.anchor.call(null); // should throw a TypeError, but doesn’t in V8

Here’s a list of the methods that have this issue:

* String.prototype.anchor(name)
* String.prototype.big()
* String.prototype.blink()
* String.prototype.bold()
* String.prototype.fixed()
* String.prototype.fontcolor(color)
* String.prototype.fontsize(size)
* String.prototype.italics()
* String.prototype.link(href)
* String.prototype.small()
* String.prototype.strike()
* String.prototype.sub()
* String.prototype.substr(start, length)
* String.prototype.sup()

Tests: http://mathias.html5.org/tests/javascript/string/ (Note: some of these tests fail because of a separate issue, i.e. bug 2217.)

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to