OLD | NEW |
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 /** \mainpage V8 API Reference Guide | 5 /** \mainpage V8 API Reference Guide |
6 * | 6 * |
7 * V8 is Google's open source JavaScript engine. | 7 * V8 is Google's open source JavaScript engine. |
8 * | 8 * |
9 * This set of documents provides reference material generated from the | 9 * This set of documents provides reference material generated from the |
10 * V8 header file, include/v8.h. | 10 * V8 header file, include/v8.h. |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 class Maybe; | 85 class Maybe; |
86 class Name; | 86 class Name; |
87 class Number; | 87 class Number; |
88 class NumberObject; | 88 class NumberObject; |
89 class Object; | 89 class Object; |
90 class ObjectOperationDescriptor; | 90 class ObjectOperationDescriptor; |
91 class ObjectTemplate; | 91 class ObjectTemplate; |
92 class Platform; | 92 class Platform; |
93 class Primitive; | 93 class Primitive; |
94 class Promise; | 94 class Promise; |
| 95 class Proxy; |
95 class RawOperationDescriptor; | 96 class RawOperationDescriptor; |
96 class Script; | 97 class Script; |
97 class SharedArrayBuffer; | 98 class SharedArrayBuffer; |
98 class Signature; | 99 class Signature; |
99 class StartupData; | 100 class StartupData; |
100 class StackFrame; | 101 class StackFrame; |
101 class StackTrace; | 102 class StackTrace; |
102 class String; | 103 class String; |
103 class StringObject; | 104 class StringObject; |
104 class Symbol; | 105 class Symbol; |
(...skipping 1842 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1947 * This is an experimental feature. | 1948 * This is an experimental feature. |
1948 */ | 1949 */ |
1949 bool IsDataView() const; | 1950 bool IsDataView() const; |
1950 | 1951 |
1951 /** | 1952 /** |
1952 * Returns true if this value is a SharedArrayBuffer. | 1953 * Returns true if this value is a SharedArrayBuffer. |
1953 * This is an experimental feature. | 1954 * This is an experimental feature. |
1954 */ | 1955 */ |
1955 bool IsSharedArrayBuffer() const; | 1956 bool IsSharedArrayBuffer() const; |
1956 | 1957 |
| 1958 /** |
| 1959 * Returns true if this value is a JavaScript Proxy. |
| 1960 */ |
| 1961 bool IsProxy() const; |
| 1962 |
1957 | 1963 |
1958 V8_WARN_UNUSED_RESULT MaybeLocal<Boolean> ToBoolean( | 1964 V8_WARN_UNUSED_RESULT MaybeLocal<Boolean> ToBoolean( |
1959 Local<Context> context) const; | 1965 Local<Context> context) const; |
1960 V8_WARN_UNUSED_RESULT MaybeLocal<Number> ToNumber( | 1966 V8_WARN_UNUSED_RESULT MaybeLocal<Number> ToNumber( |
1961 Local<Context> context) const; | 1967 Local<Context> context) const; |
1962 V8_WARN_UNUSED_RESULT MaybeLocal<String> ToString( | 1968 V8_WARN_UNUSED_RESULT MaybeLocal<String> ToString( |
1963 Local<Context> context) const; | 1969 Local<Context> context) const; |
1964 V8_WARN_UNUSED_RESULT MaybeLocal<String> ToDetailString( | 1970 V8_WARN_UNUSED_RESULT MaybeLocal<String> ToDetailString( |
1965 Local<Context> context) const; | 1971 Local<Context> context) const; |
1966 V8_WARN_UNUSED_RESULT MaybeLocal<Object> ToObject( | 1972 V8_WARN_UNUSED_RESULT MaybeLocal<Object> ToObject( |
(...skipping 1402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3369 bool HasHandler(); | 3375 bool HasHandler(); |
3370 | 3376 |
3371 V8_INLINE static Promise* Cast(Value* obj); | 3377 V8_INLINE static Promise* Cast(Value* obj); |
3372 | 3378 |
3373 private: | 3379 private: |
3374 Promise(); | 3380 Promise(); |
3375 static void CheckCast(Value* obj); | 3381 static void CheckCast(Value* obj); |
3376 }; | 3382 }; |
3377 | 3383 |
3378 | 3384 |
| 3385 /** |
| 3386 * An instance of the built-in Proxy constructor (ECMA-262, 6th Edition, |
| 3387 * 26.2.1). |
| 3388 */ |
| 3389 class V8_EXPORT Proxy : public Object { |
| 3390 public: |
| 3391 Local<Object> GetTarget(); |
| 3392 Local<Value> GetHandler(); |
| 3393 bool IsRevoked(); |
| 3394 void Revoke(); |
| 3395 |
| 3396 /** |
| 3397 * Creates a new empty Map. |
| 3398 */ |
| 3399 static MaybeLocal<Proxy> New(Local<Context> context, |
| 3400 Local<Object> local_target, |
| 3401 Local<Object> local_handler); |
| 3402 |
| 3403 V8_INLINE static Proxy* Cast(Value* obj); |
| 3404 |
| 3405 private: |
| 3406 Proxy(); |
| 3407 static void CheckCast(Value* obj); |
| 3408 }; |
| 3409 |
| 3410 |
3379 #ifndef V8_ARRAY_BUFFER_INTERNAL_FIELD_COUNT | 3411 #ifndef V8_ARRAY_BUFFER_INTERNAL_FIELD_COUNT |
3380 // The number of required internal fields can be defined by embedder. | 3412 // The number of required internal fields can be defined by embedder. |
3381 #define V8_ARRAY_BUFFER_INTERNAL_FIELD_COUNT 2 | 3413 #define V8_ARRAY_BUFFER_INTERNAL_FIELD_COUNT 2 |
3382 #endif | 3414 #endif |
3383 | 3415 |
3384 | 3416 |
3385 enum class ArrayBufferCreationMode { kInternalized, kExternalized }; | 3417 enum class ArrayBufferCreationMode { kInternalized, kExternalized }; |
3386 | 3418 |
3387 | 3419 |
3388 /** | 3420 /** |
(...skipping 4651 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8040 | 8072 |
8041 | 8073 |
8042 Promise* Promise::Cast(v8::Value* value) { | 8074 Promise* Promise::Cast(v8::Value* value) { |
8043 #ifdef V8_ENABLE_CHECKS | 8075 #ifdef V8_ENABLE_CHECKS |
8044 CheckCast(value); | 8076 CheckCast(value); |
8045 #endif | 8077 #endif |
8046 return static_cast<Promise*>(value); | 8078 return static_cast<Promise*>(value); |
8047 } | 8079 } |
8048 | 8080 |
8049 | 8081 |
| 8082 Proxy* Proxy::Cast(v8::Value* value) { |
| 8083 #ifdef V8_ENABLE_CHECKS |
| 8084 CheckCast(value); |
| 8085 #endif |
| 8086 return static_cast<Proxy*>(value); |
| 8087 } |
| 8088 |
| 8089 |
8050 Promise::Resolver* Promise::Resolver::Cast(v8::Value* value) { | 8090 Promise::Resolver* Promise::Resolver::Cast(v8::Value* value) { |
8051 #ifdef V8_ENABLE_CHECKS | 8091 #ifdef V8_ENABLE_CHECKS |
8052 CheckCast(value); | 8092 CheckCast(value); |
8053 #endif | 8093 #endif |
8054 return static_cast<Promise::Resolver*>(value); | 8094 return static_cast<Promise::Resolver*>(value); |
8055 } | 8095 } |
8056 | 8096 |
8057 | 8097 |
8058 ArrayBuffer* ArrayBuffer::Cast(v8::Value* value) { | 8098 ArrayBuffer* ArrayBuffer::Cast(v8::Value* value) { |
8059 #ifdef V8_ENABLE_CHECKS | 8099 #ifdef V8_ENABLE_CHECKS |
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8465 */ | 8505 */ |
8466 | 8506 |
8467 | 8507 |
8468 } // namespace v8 | 8508 } // namespace v8 |
8469 | 8509 |
8470 | 8510 |
8471 #undef TYPE_CHECK | 8511 #undef TYPE_CHECK |
8472 | 8512 |
8473 | 8513 |
8474 #endif // INCLUDE_V8_H_ | 8514 #endif // INCLUDE_V8_H_ |
OLD | NEW |