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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/js/proxy.js » ('j') | src/objects.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/builtins.h" 5 #include "src/builtins.h"
6 6
7 #include "src/api.h" 7 #include "src/api.h"
8 #include "src/api-natives.h" 8 #include "src/api-natives.h"
9 #include "src/arguments.h" 9 #include "src/arguments.h"
10 #include "src/base/once.h" 10 #include "src/base/once.h"
(...skipping 1781 matching lines...) Expand 10 before | Expand all | Expand 10 after
1792 isolate, 1792 isolate,
1793 NewTypeError(MessageTemplate::kConstructorNotFunction, 1793 NewTypeError(MessageTemplate::kConstructorNotFunction,
1794 isolate->factory()->NewStringFromAsciiChecked("Proxy"))); 1794 isolate->factory()->NewStringFromAsciiChecked("Proxy")));
1795 } 1795 }
1796 1796
1797 1797
1798 // ES6 section 26.2.1.1 Proxy ( target, handler ) for the [[Construct]] case. 1798 // ES6 section 26.2.1.1 Proxy ( target, handler ) for the [[Construct]] case.
1799 BUILTIN(ProxyConstructor_ConstructStub) { 1799 BUILTIN(ProxyConstructor_ConstructStub) {
1800 HandleScope scope(isolate); 1800 HandleScope scope(isolate);
1801 DCHECK(isolate->proxy_function()->IsConstructor()); 1801 DCHECK(isolate->proxy_function()->IsConstructor());
1802 DCHECK_EQ(3, args.length()); 1802 Handle<Object> target;
1803 Handle<Object> target = args.at<Object>(1); 1803 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 :)
1804 Handle<Object> handler = args.at<Object>(2); 1804 target = isolate->factory()->undefined_value();
1805 } else {
1806 target = args.at<Object>(1);
1807 }
1808 Handle<Object> handler;
1809 if (args.length() < 3) {
1810 handler = isolate->factory()->undefined_value();
1811 } else {
1812 handler = args.at<Object>(2);
1813 }
1805 // The ConstructStub is executed in the context of the caller, so we need 1814 // The ConstructStub is executed in the context of the caller, so we need
1806 // to enter the callee context first before raising an exception. 1815 // to enter the callee context first before raising an exception.
1807 isolate->set_context(args.target()->context()); 1816 isolate->set_context(args.target()->context());
1808 Handle<JSProxy> result; 1817 Handle<JSProxy> result;
1809 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result, 1818 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, result,
1810 ProxyCreate(isolate, target, handler)); 1819 ProxyCreate(isolate, target, handler));
1811 return *result; 1820 return *result;
1812 } 1821 }
1813 1822
1814 1823
(...skipping 622 matching lines...) Expand 10 before | Expand all | Expand 10 after
2437 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C) 2446 BUILTIN_LIST_C(DEFINE_BUILTIN_ACCESSOR_C)
2438 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A) 2447 BUILTIN_LIST_A(DEFINE_BUILTIN_ACCESSOR_A)
2439 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) 2448 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H)
2440 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) 2449 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A)
2441 #undef DEFINE_BUILTIN_ACCESSOR_C 2450 #undef DEFINE_BUILTIN_ACCESSOR_C
2442 #undef DEFINE_BUILTIN_ACCESSOR_A 2451 #undef DEFINE_BUILTIN_ACCESSOR_A
2443 2452
2444 2453
2445 } // namespace internal 2454 } // namespace internal
2446 } // namespace v8 2455 } // namespace v8
OLDNEW
« 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