Index: src/messages.js |
diff --git a/src/messages.js b/src/messages.js |
index a0f366b10b2f36d850fe900504ae29020ad82a34..757e6f68296269a55ada16b88e74ca1bd680ca98 100644 |
--- a/src/messages.js |
+++ b/src/messages.js |
@@ -6,12 +6,9 @@ |
var kMessages = { |
// Error |
- cyclic_proto: ["Cyclic __proto__ value"], |
- code_gen_from_strings: ["%0"], |
constructor_is_generator: ["Class constructor may not be a generator"], |
constructor_is_accessor: ["Class constructor may not be an accessor"], |
// TypeError |
- generator_running: ["Generator is already running"], |
unexpected_token: ["Unexpected token ", "%0"], |
unexpected_token_number: ["Unexpected number"], |
unexpected_token_string: ["Unexpected string"], |
@@ -27,7 +24,6 @@ var kMessages = { |
unterminated_template_expr: ["Missing } in template expression"], |
unterminated_arg_list: ["missing ) after argument list"], |
regexp_flags: ["Cannot supply flags when constructing one RegExp from another"], |
- incompatible_method_receiver: ["Method ", "%0", " called on incompatible receiver ", "%1"], |
multiple_defaults_in_switch: ["More than one default clause in switch statement"], |
newline_after_throw: ["Illegal newline after throw"], |
label_redeclaration: ["Label '", "%0", "' has already been declared"], |
@@ -36,8 +32,6 @@ var kMessages = { |
no_catch_or_finally: ["Missing catch or finally after try"], |
unknown_label: ["Undefined label '", "%0", "'"], |
uncaught_exception: ["Uncaught ", "%0"], |
- stack_trace: ["Stack Trace:\n", "%0"], |
- called_non_callable: ["%0", " is not a function"], |
undefined_method: ["Object ", "%1", " has no method '", "%0", "'"], |
cannot_convert_to_primitive: ["Cannot convert object to primitive value"], |
not_constructor: ["%0", " is not a constructor"], |
@@ -318,13 +312,8 @@ function ToDetailString(obj) { |
} |
-function MakeGenericError(constructor, type, args) { |
- if (IS_UNDEFINED(args)) args = []; |
- return new constructor(FormatMessage(type, args)); |
-} |
- |
- |
-function MakeGenericError2(constructor, type, arg0, arg1, arg2) { |
+function MakeGenericError(constructor, type, arg0, arg1, arg2) { |
+ if (IS_UNDEFINED(arg0) && IS_STRING(type)) arg0 = []; |
return new constructor(FormatMessage(type, arg0, arg1, arg2)); |
} |
@@ -381,42 +370,35 @@ function GetSourceLine(message) { |
} |
-function MakeTypeError(type, args) { |
- return MakeGenericError($TypeError, type, args); |
+function MakeError(type, arg0, arg1, arg2) { |
+ return MakeGenericError($Error, type, arg0, arg1, arg2); |
} |
-// TODO(yangguo): rename this once we migrated all messages. |
-function MakeTypeError2(type, arg0, arg1, arg2) { |
- return MakeGenericError2($TypeError, type, arg0, arg1, arg2); |
+function MakeTypeError(type, arg0, arg1, arg2) { |
+ return MakeGenericError($TypeError, type, arg0, arg1, arg2); |
} |
-function MakeRangeError(type, args) { |
- return MakeGenericError($RangeError, type, args); |
+function MakeRangeError(type, arg0, arg1, arg2) { |
+ return MakeGenericError($RangeError, type, arg0, arg1, arg2); |
} |
-function MakeSyntaxError(type, args) { |
- return MakeGenericError($SyntaxError, type, args); |
+function MakeSyntaxError(type, arg0, arg1, arg2) { |
+ return MakeGenericError($SyntaxError, type, arg0, arg1, arg2); |
} |
-function MakeReferenceError(type, args) { |
- return MakeGenericError($ReferenceError, type, args); |
+function MakeReferenceError(type, arg0, arg1, arg2) { |
+ return MakeGenericError($ReferenceError, type, arg0, arg1, arg2); |
} |
-function MakeEvalError(type, args) { |
- return MakeGenericError($EvalError, type, args); |
+function MakeEvalError(type, arg0, arg1, arg2) { |
+ return MakeGenericError($EvalError, type, arg0, arg1, arg2); |
} |
- |
-function MakeError(type, args) { |
- return MakeGenericError($Error, type, args); |
-} |
- |
- |
// The embedded versions are called from unoptimized code, with embedded |
// arguments. Those arguments cannot be arrays, which are context-dependent. |
function MakeTypeErrorEmbedded(type, arg) { |