Add missing error message for calling functions on incompatible receivers.
authorager@chromium.org <ager@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Fri, 26 Feb 2010 15:46:57 +0000 (15:46 +0000)
committerager@chromium.org <ager@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Fri, 26 Feb 2010 15:46:57 +0000 (15:46 +0000)
Review URL: http://codereview.chromium.org/660178

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3978 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/messages.js
src/regexp-delay.js

index ca82afe5338e9b12e1c51e1a5111e4abef326158..5848115059b3ec5d91a6e567dff50503632bc2c4 100644 (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",
index 7bec455d37fedd46702d36f02db20ed6d6396d71..6b9ff9c79a8adb4369001b5e9a2858c5a53b59ce 100644 (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) {