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

Unified Diff: src/array.js

Issue 1096243003: Migrate error messages, part 5 (array.js and i18n.js). (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 8 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 | « no previous file | src/date.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/array.js
diff --git a/src/array.js b/src/array.js
index e9cd9c02247e2a6d829d23e29500b5c6a77c7351..e0a1fc98a655053c42e5dbadcb19032d5210e237 100644
--- a/src/array.js
+++ b/src/array.js
@@ -620,10 +620,7 @@ function ArrayShift() {
return;
}
- if (ObjectIsSealed(array)) {
- throw MakeTypeError("array_functions_change_sealed",
- ["Array.prototype.shift"]);
- }
+ if (ObjectIsSealed(array)) throw MakeTypeError(kArrayFunctionsOnSealed);
if (%IsObserved(array))
return ObservedArrayShift.call(array, len);
@@ -821,11 +818,9 @@ function ArraySplice(start, delete_count) {
var num_elements_to_add = num_arguments > 2 ? num_arguments - 2 : 0;
if (del_count != num_elements_to_add && ObjectIsSealed(array)) {
- throw MakeTypeError("array_functions_change_sealed",
- ["Array.prototype.splice"]);
+ throw MakeTypeError(kArrayFunctionsOnSealed);
} else if (del_count > 0 && ObjectIsFrozen(array)) {
- throw MakeTypeError("array_functions_on_frozen",
- ["Array.prototype.splice"]);
+ throw MakeTypeError(kArrayFunctionsOnFrozen);
}
var changed_elements = del_count;
@@ -1446,7 +1441,7 @@ function ArrayReduce(callback, current) {
break find_initial;
}
}
- throw MakeTypeError('reduce_no_initial', []);
+ throw MakeTypeError(kReduceNoInitial);
}
var receiver = %GetDefaultReceiver(callback);
@@ -1484,7 +1479,7 @@ function ArrayReduceRight(callback, current) {
break find_initial;
}
}
- throw MakeTypeError('reduce_no_initial', []);
+ throw MakeTypeError(kReduceNoInitial);
}
var receiver = %GetDefaultReceiver(callback);
« no previous file with comments | « no previous file | src/date.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698