Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-21 10:05:26

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