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

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: 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 | « no previous file | src/js/proxy.js » ('j') | src/objects.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
« no previous file with comments | « no previous file | src/js/proxy.js » ('j') | src/objects.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698