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

Unified Diff: src/array.js

Issue 1086313003: Migrate error messages, part 2. (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/array-iterator.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 68796dda353793be922f506869472be4cfebb572..b2e26e0305418680a84d52a19150dcfae8290ef2 100644
--- a/src/array.js
+++ b/src/array.js
@@ -1142,9 +1142,7 @@ function ArrayFilter(f, receiver) {
var array = ToObject(this);
var length = ToUint32(array.length);
- if (!IS_SPEC_FUNCTION(f)) {
- throw MakeTypeError('called_non_callable', [ f ]);
- }
+ if (!IS_SPEC_FUNCTION(f)) throw MakeTypeError(kCalledNonCallable, f);
var needs_wrapper = false;
if (IS_NULL_OR_UNDEFINED(receiver)) {
receiver = %GetDefaultReceiver(f) || receiver;
@@ -1181,9 +1179,7 @@ function ArrayForEach(f, receiver) {
var array = ToObject(this);
var length = TO_UINT32(array.length);
- if (!IS_SPEC_FUNCTION(f)) {
- throw MakeTypeError('called_non_callable', [ f ]);
- }
+ if (!IS_SPEC_FUNCTION(f)) throw MakeTypeError(kCalledNonCallable, f);
var needs_wrapper = false;
if (IS_NULL_OR_UNDEFINED(receiver)) {
receiver = %GetDefaultReceiver(f) || receiver;
@@ -1215,9 +1211,7 @@ function ArraySome(f, receiver) {
var array = ToObject(this);
var length = TO_UINT32(array.length);
- if (!IS_SPEC_FUNCTION(f)) {
- throw MakeTypeError('called_non_callable', [ f ]);
- }
+ if (!IS_SPEC_FUNCTION(f)) throw MakeTypeError(kCalledNonCallable, f);
var needs_wrapper = false;
if (IS_NULL_OR_UNDEFINED(receiver)) {
receiver = %GetDefaultReceiver(f) || receiver;
@@ -1248,9 +1242,7 @@ function ArrayEvery(f, receiver) {
var array = ToObject(this);
var length = TO_UINT32(array.length);
- if (!IS_SPEC_FUNCTION(f)) {
- throw MakeTypeError('called_non_callable', [ f ]);
- }
+ if (!IS_SPEC_FUNCTION(f)) throw MakeTypeError(kCalledNonCallable, f);
var needs_wrapper = false;
if (IS_NULL_OR_UNDEFINED(receiver)) {
receiver = %GetDefaultReceiver(f) || receiver;
@@ -1280,9 +1272,7 @@ function ArrayMap(f, receiver) {
var array = ToObject(this);
var length = TO_UINT32(array.length);
- if (!IS_SPEC_FUNCTION(f)) {
- throw MakeTypeError('called_non_callable', [ f ]);
- }
+ if (!IS_SPEC_FUNCTION(f)) throw MakeTypeError(kCalledNonCallable, f);
var needs_wrapper = false;
if (IS_NULL_OR_UNDEFINED(receiver)) {
receiver = %GetDefaultReceiver(f) || receiver;
@@ -1427,7 +1417,7 @@ function ArrayReduce(callback, current) {
var length = ToUint32(array.length);
if (!IS_SPEC_FUNCTION(callback)) {
- throw MakeTypeError('called_non_callable', [callback]);
+ throw MakeTypeError(kCalledNonCallable, callback);
}
var is_array = IS_ARRAY(array);
@@ -1464,7 +1454,7 @@ function ArrayReduceRight(callback, current) {
var length = ToUint32(array.length);
if (!IS_SPEC_FUNCTION(callback)) {
- throw MakeTypeError('called_non_callable', [callback]);
+ throw MakeTypeError(kCalledNonCallable, callback);
}
var is_array = IS_ARRAY(array);
« no previous file with comments | « no previous file | src/array-iterator.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698