Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-01-07 10:10:00

0001 // Copyright 2021 the V8 project authors. All rights reserved.
0002 // Use of this source code is governed by a BSD-style license that can be
0003 // found in the LICENSE file.
0004 
0005 #ifndef INCLUDE_V8_PROXY_H_
0006 #define INCLUDE_V8_PROXY_H_
0007 
0008 #include "v8-context.h"       // NOLINT(build/include_directory)
0009 #include "v8-local-handle.h"  // NOLINT(build/include_directory)
0010 #include "v8-object.h"        // NOLINT(build/include_directory)
0011 #include "v8config.h"         // NOLINT(build/include_directory)
0012 
0013 namespace v8 {
0014 
0015 class Context;
0016 
0017 /**
0018  * An instance of the built-in Proxy constructor (ECMA-262, 6th Edition,
0019  * 26.2.1).
0020  */
0021 class V8_EXPORT Proxy : public Object {
0022  public:
0023   Local<Value> GetTarget();
0024   Local<Value> GetHandler();
0025   bool IsRevoked() const;
0026   void Revoke();
0027 
0028   /**
0029    * Creates a new Proxy for the target object.
0030    */
0031   static MaybeLocal<Proxy> New(Local<Context> context,
0032                                Local<Object> local_target,
0033                                Local<Object> local_handler);
0034 
0035   V8_INLINE static Proxy* Cast(Value* value) {
0036 #ifdef V8_ENABLE_CHECKS
0037     CheckCast(value);
0038 #endif
0039     return static_cast<Proxy*>(value);
0040   }
0041 
0042  private:
0043   Proxy();
0044   static void CheckCast(Value* obj);
0045 };
0046 
0047 }  // namespace v8
0048 
0049 #endif  // INCLUDE_V8_PROXY_H_