Add missing error message for calling functions on incompatible receivers.

Review URL: http://codereview.chromium.org/660178

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3978 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
ager@chromium.org 2010-02-26 15:46:57 +00:00
parent 3051ba1a5b
commit b299c61976
2 changed files with 3 additions and 2 deletions

View File

@ -127,6 +127,7 @@ function FormatMessage(message) {
malformed_regexp: "Invalid regular expression: /%0/: %1",
unterminated_regexp: "Invalid regular expression: missing /",
regexp_flags: "Cannot supply flags when constructing one RegExp from another",
incompatible_method_receiver: "Method %0 called on incompatible receiver %1",
invalid_lhs_in_assignment: "Invalid left-hand side in assignment",
invalid_lhs_in_for_in: "Invalid left-hand side in for-in",
invalid_lhs_in_postfix_op: "Invalid left-hand side expression in postfix operation",

View File

@ -142,7 +142,7 @@ function DoRegExpExec(regexp, string, index) {
function RegExpExec(string) {
if (!IS_REGEXP(this)) {
throw MakeTypeError('method_called_on_incompatible',
throw MakeTypeError('incompatible_method_receiver',
['RegExp.prototype.exec', this]);
}
if (%_ArgumentsLength() == 0) {
@ -199,7 +199,7 @@ function RegExpExec(string) {
// else implements.
function RegExpTest(string) {
if (!IS_REGEXP(this)) {
throw MakeTypeError('method_called_on_incompatible',
throw MakeTypeError('incompatible_method_receiver',
['RegExp.prototype.test', this]);
}
if (%_ArgumentsLength() == 0) {