| Index: src/builtins/builtins-proxy.cc
|
| diff --git a/src/builtins/builtins-proxy.cc b/src/builtins/builtins-proxy.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..05ba3041a7ab9409c51b86b8a8c20e32c1bb9b5a
|
| --- /dev/null
|
| +++ b/src/builtins/builtins-proxy.cc
|
| @@ -0,0 +1,30 @@
|
| +// Copyright 2016 the V8 project authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "src/builtins/builtins.h"
|
| +#include "src/builtins/builtins-utils.h"
|
| +
|
| +namespace v8 {
|
| +namespace internal {
|
| +
|
| +// ES6 section 26.2.1.1 Proxy ( target, handler ) for the [[Call]] case.
|
| +BUILTIN(ProxyConstructor) {
|
| + HandleScope scope(isolate);
|
| + THROW_NEW_ERROR_RETURN_FAILURE(
|
| + isolate,
|
| + NewTypeError(MessageTemplate::kConstructorNotFunction,
|
| + isolate->factory()->NewStringFromAsciiChecked("Proxy")));
|
| +}
|
| +
|
| +// ES6 section 26.2.1.1 Proxy ( target, handler ) for the [[Construct]] case.
|
| +BUILTIN(ProxyConstructor_ConstructStub) {
|
| + HandleScope scope(isolate);
|
| + DCHECK(isolate->proxy_function()->IsConstructor());
|
| + Handle<Object> target = args.atOrUndefined(isolate, 1);
|
| + Handle<Object> handler = args.atOrUndefined(isolate, 2);
|
| + RETURN_RESULT_OR_FAILURE(isolate, JSProxy::New(isolate, target, handler));
|
| +}
|
| +
|
| +} // namespace internal
|
| +} // namespace v8
|
|
|