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

Unified Diff: src/harmony-array.js

Issue 132333019: Use `CHECK_OBJECT_COERCIBLE` macro where possible (Closed) Base URL: git@github.com:v8/v8.git@master
Patch Set: Don’t update copyright year Created 6 years, 11 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/array.js ('k') | src/v8natives.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/harmony-array.js
diff --git a/src/harmony-array.js b/src/harmony-array.js
index a9cc3b83841093f17a46afb3433059aa446b23d8..2cedebaae13b4f5823e12dc279c2ecb1becd0993 100644
--- a/src/harmony-array.js
+++ b/src/harmony-array.js
@@ -35,10 +35,7 @@
// ES6 draft 07-15-13, section 15.4.3.23
function ArrayFind(predicate /* thisArg */) { // length == 1
- if (IS_NULL_OR_UNDEFINED(this) && !IS_UNDETECTABLE(this)) {
- throw MakeTypeError("called_on_null_or_undefined",
- ["Array.prototype.find"]);
- }
+ CHECK_OBJECT_COERCIBLE(this, "Array.prototype.find");
var array = ToObject(this);
var length = ToInteger(array.length);
@@ -73,10 +70,7 @@ function ArrayFind(predicate /* thisArg */) { // length == 1
// ES6 draft 07-15-13, section 15.4.3.24
function ArrayFindIndex(predicate /* thisArg */) { // length == 1
- if (IS_NULL_OR_UNDEFINED(this) && !IS_UNDETECTABLE(this)) {
- throw MakeTypeError("called_on_null_or_undefined",
- ["Array.prototype.findIndex"]);
- }
+ CHECK_OBJECT_COERCIBLE(this, "Array.prototype.findIndex");
var array = ToObject(this);
var length = ToInteger(array.length);
« no previous file with comments | « src/array.js ('k') | src/v8natives.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698