Status: New
Owner: ----

New issue 1981 by [email protected]: RegExp.prototype.toString does not throw TypeError if called with incompatible 'this' Object
http://code.google.com/p/v8/issues/detail?id=1981

V8 version 3.9.13 [console: readline]
d8> RegExp.prototype.toString.call(2)
/(?:)/

ES5.1, 15.10.6:
[...]
In the following descriptions of functions that are properties of the RegExp prototype object, the phrase "this RegExp object" refers to the object that is the this value for the invocation of the function; a TypeError exception is thrown if the this value is not an object or an object for which the value of the [[Class]] internal property is not "RegExp".

And 15.10.6.4  RegExp.prototype.toString()
Return the String value formed by concatenating the Strings "/", the String value of the source property of this RegExp object [...]

15.10.6.4 + 15.10.6 make clear that a TypeError should be thrown. Other functions on RegExp.prototype are not affected, that means they throw a TypeError.

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

Reply via email to