Index: src/builtins.cc |
diff --git a/src/builtins.cc b/src/builtins.cc |
index 74bcab553dc370bde58d006fc1128959e7f16f01..42314b66992ac32d0c4ed685a9a4140485b5cb6c 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) { |
caitp (gmail)
2015/12/10 15:15:25
Perhaps it makes sense to implement this "if index
Camillo Bruni
2015/12/10 20:22:13
right, I'll put it on my Friday-cleanup list :)
|
+ 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()); |