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

Unified Diff: src/v8natives.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/harmony-array.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/v8natives.js
diff --git a/src/v8natives.js b/src/v8natives.js
index b0b66e760b32118be5876b223a3292844a0ae439..3c669403132bc99f743e16f7e8d3080613a8e432 100644
--- a/src/v8natives.js
+++ b/src/v8natives.js
@@ -247,10 +247,7 @@ function ObjectToString() {
// ECMA-262 - 15.2.4.3
function ObjectToLocaleString() {
- if (IS_NULL_OR_UNDEFINED(this) && !IS_UNDETECTABLE(this)) {
- throw MakeTypeError("called_on_null_or_undefined",
- ["Object.prototype.toLocaleString"]);
- }
+ CHECK_OBJECT_COERCIBLE(this, "Object.prototype.toLocaleString");
return this.toString();
}
@@ -276,10 +273,7 @@ function ObjectHasOwnProperty(V) {
// ECMA-262 - 15.2.4.6
function ObjectIsPrototypeOf(V) {
- if (IS_NULL_OR_UNDEFINED(this) && !IS_UNDETECTABLE(this)) {
- throw MakeTypeError("called_on_null_or_undefined",
- ["Object.prototype.isPrototypeOf"]);
- }
+ CHECK_OBJECT_COERCIBLE(this, "Object.prototype.isPrototypeOf");
if (!IS_SPEC_OBJECT(V)) return false;
return %IsInPrototypeChain(this, V);
}
« no previous file with comments | « src/harmony-array.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698