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

Unified Diff: src/builtins.cc

Issue 1516843002: [proxy] fixing harmony/proxy.js tests and improving error messages + some drive-by fixes (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: WIP fix protoype walks with access checks 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
Index: src/builtins.cc
diff --git a/src/builtins.cc b/src/builtins.cc
index 2f5c52098dca0adcdffb9f5e730b46de9e492f05..02dce6bdf632433bae4717ffb2e8add156867d0e 100644
--- a/src/builtins.cc
+++ b/src/builtins.cc
@@ -1799,9 +1799,18 @@ BUILTIN(ProxyConstructor) {
BUILTIN(ProxyConstructor_ConstructStub) {
HandleScope scope(isolate);
DCHECK(isolate->proxy_function()->IsConstructor());
- DCHECK_EQ(3, args.length());
- Handle<Object> target = args.at<Object>(1);
- Handle<Object> handler = args.at<Object>(2);
+ Handle<Object> target;
+ if (args.length() < 2) {
+ target = isolate->factory()->undefined_value();
+ } else {
+ target = args.at<Object>(1);
+ }
+ Handle<Object> handler;
+ if (args.length() < 3) {
+ handler = isolate->factory()->undefined_value();
+ } else {
+ handler = args.at<Object>(2);
+ }
// The ConstructStub is executed in the context of the caller, so we need
// to enter the callee context first before raising an exception.
isolate->set_context(args.target()->context());
« no previous file with comments | « no previous file | src/compiler/js-generic-lowering.cc » ('j') | test/mjsunit/harmony/proxies-cross-realm-ecxeption.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698