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

Unified Diff: src/js/v8natives.js

Issue 1527583002: [proxies] Improve error messages. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address comment. Created 5 years 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/proxy.js ('k') | src/messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/js/v8natives.js
diff --git a/src/js/v8natives.js b/src/js/v8natives.js
index c73735d3b28063b26b237dda901dd9b9fb7a348d..0003f9f5096d51e34ecfaf2ee2be8951eb75f060 100644
--- a/src/js/v8natives.js
+++ b/src/js/v8natives.js
@@ -475,11 +475,11 @@ function GetTrap(handler, name, defaultTrap) {
var trap = handler[name];
if (IS_UNDEFINED(trap)) {
if (IS_UNDEFINED(defaultTrap)) {
- throw MakeTypeError(kProxyHandlerTrapMissing, handler, name);
+ throw MakeTypeError(kIllegalInvocation);
}
trap = defaultTrap;
} else if (!IS_CALLABLE(trap)) {
- throw MakeTypeError(kProxyHandlerTrapMustBeCallable, handler, name);
+ throw MakeTypeError(kIllegalInvocation);
}
return trap;
}
@@ -510,8 +510,7 @@ function GetOwnPropertyJS(obj, v) {
if (IS_UNDEFINED(descriptor)) return descriptor;
var desc = ToCompletePropertyDescriptor(descriptor);
if (!desc.isConfigurable()) {
- throw MakeTypeError(kProxyPropNotConfigurable,
- handler, p, "getOwnPropertyDescriptor");
+ throw MakeTypeError(kIllegalInvocation);
}
return desc;
}
@@ -543,8 +542,7 @@ function DefineProxyProperty(obj, p, attributes, should_throw) {
var result = CallTrap2(handler, "defineProperty", UNDEFINED, p, attributes);
if (!result) {
if (should_throw) {
- throw MakeTypeError(kProxyTrapReturned,
- handler, "false", "defineProperty");
+ throw MakeTypeError(kIllegalInvocation);
} else {
return false;
}
@@ -782,7 +780,7 @@ function ObjectGetPrototypeOf(obj) {
return %_GetPrototype(TO_OBJECT(obj));
}
-// ES6 section 19.1.2.19.
+// ES6 section 19.1.2.18.
function ObjectSetPrototypeOf(obj, proto) {
CHECK_OBJECT_COERCIBLE(obj, "Object.setPrototypeOf");
« no previous file with comments | « src/js/proxy.js ('k') | src/messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698