Commit b299c619 authored by ager@chromium.org's avatar ager@chromium.org

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
parent 3051ba1a
...@@ -127,6 +127,7 @@ function FormatMessage(message) { ...@@ -127,6 +127,7 @@ function FormatMessage(message) {
malformed_regexp: "Invalid regular expression: /%0/: %1", malformed_regexp: "Invalid regular expression: /%0/: %1",
unterminated_regexp: "Invalid regular expression: missing /", unterminated_regexp: "Invalid regular expression: missing /",
regexp_flags: "Cannot supply flags when constructing one RegExp from another", 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_assignment: "Invalid left-hand side in assignment",
invalid_lhs_in_for_in: "Invalid left-hand side in for-in", 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", invalid_lhs_in_postfix_op: "Invalid left-hand side expression in postfix operation",
......
...@@ -142,7 +142,7 @@ function DoRegExpExec(regexp, string, index) { ...@@ -142,7 +142,7 @@ function DoRegExpExec(regexp, string, index) {
function RegExpExec(string) { function RegExpExec(string) {
if (!IS_REGEXP(this)) { if (!IS_REGEXP(this)) {
throw MakeTypeError('method_called_on_incompatible', throw MakeTypeError('incompatible_method_receiver',
['RegExp.prototype.exec', this]); ['RegExp.prototype.exec', this]);
} }
if (%_ArgumentsLength() == 0) { if (%_ArgumentsLength() == 0) {
...@@ -199,7 +199,7 @@ function RegExpExec(string) { ...@@ -199,7 +199,7 @@ function RegExpExec(string) {
// else implements. // else implements.
function RegExpTest(string) { function RegExpTest(string) {
if (!IS_REGEXP(this)) { if (!IS_REGEXP(this)) {
throw MakeTypeError('method_called_on_incompatible', throw MakeTypeError('incompatible_method_receiver',
['RegExp.prototype.test', this]); ['RegExp.prototype.test', this]);
} }
if (%_ArgumentsLength() == 0) { if (%_ArgumentsLength() == 0) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment