Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(105)

Unified Diff: src/js/messages.js

Issue 1413173003: Move error message makers off js builtins object. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/js/json.js ('k') | src/js/object-observe.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/js/messages.js
diff --git a/src/js/messages.js b/src/js/messages.js
index e98178d1305d045733149ae61d0dcef45a219cee..481d3eb10689de941a07c38ed2e2c7e83f3e6f95 100644
--- a/src/js/messages.js
+++ b/src/js/messages.js
@@ -4,14 +4,6 @@
// -------------------------------------------------------------------
-var MakeError;
-var MakeEvalError;
-var MakeRangeError;
-var MakeReferenceError;
-var MakeSyntaxError;
-var MakeTypeError;
-var MakeURIError;
-
(function(global, utils) {
%CheckIsBootstrapping();
@@ -972,6 +964,9 @@ GlobalURIError = DefineError(global, function URIError() { });
%AddNamedProperty(GlobalError.prototype, 'message', '', DONT_ENUM);
+utils.InstallFunctions(GlobalError.prototype, DONT_ENUM,
+ ['toString', ErrorToString]);
+
function ErrorToString() {
if (!IS_SPEC_OBJECT(this)) {
throw MakeTypeError(kCalledOnNonObject, "Error.prototype.toString");
@@ -980,26 +975,23 @@ function ErrorToString() {
return %ErrorToStringRT(this);
}
-utils.InstallFunctions(GlobalError.prototype, DONT_ENUM,
- ['toString', ErrorToString]);
-
-MakeError = function(type, arg0, arg1, arg2) {
+function MakeError(type, arg0, arg1, arg2) {
return MakeGenericError(GlobalError, type, arg0, arg1, arg2);
}
-MakeRangeError = function(type, arg0, arg1, arg2) {
+function MakeRangeError(type, arg0, arg1, arg2) {
return MakeGenericError(GlobalRangeError, type, arg0, arg1, arg2);
}
-MakeSyntaxError = function(type, arg0, arg1, arg2) {
+function MakeSyntaxError(type, arg0, arg1, arg2) {
return MakeGenericError(GlobalSyntaxError, type, arg0, arg1, arg2);
}
-MakeTypeError = function(type, arg0, arg1, arg2) {
+function MakeTypeError(type, arg0, arg1, arg2) {
return MakeGenericError(GlobalTypeError, type, arg0, arg1, arg2);
}
-MakeURIError = function() {
+function MakeURIError() {
return MakeGenericError(GlobalURIError, kURIMalformed);
}
@@ -1043,6 +1035,11 @@ GlobalError.captureStackTrace = captureStackTrace;
utils.Export(function(to) {
to.ErrorToString = ErrorToString;
+ to.MakeError = MakeError;
+ to.MakeRangeError = MakeRangeError;
+ to.MakeSyntaxError = MakeSyntaxError;
+ to.MakeTypeError = MakeTypeError;
+ to.MakeURIError = MakeURIError;
});
});
« no previous file with comments | « src/js/json.js ('k') | src/js/object-observe.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698