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 1052 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1063 */ | 1063 */ |
1064 V8_WARN_UNUSED_RESULT bool Instantiate(Local<Context> context, | 1064 V8_WARN_UNUSED_RESULT bool Instantiate(Local<Context> context, |
1065 ResolveCallback callback); | 1065 ResolveCallback callback); |
1066 | 1066 |
1067 /** | 1067 /** |
1068 * ModuleEvaluation | 1068 * ModuleEvaluation |
1069 * | 1069 * |
1070 * Returns the completion value. | 1070 * Returns the completion value. |
1071 */ | 1071 */ |
1072 V8_WARN_UNUSED_RESULT MaybeLocal<Value> Evaluate(Local<Context> context); | 1072 V8_WARN_UNUSED_RESULT MaybeLocal<Value> Evaluate(Local<Context> context); |
1073 | |
1074 /** | |
1075 * Resolves the promise with the namespace object of the given | |
1076 * module. | |
1077 */ | |
1078 static V8_WARN_UNUSED_RESULT bool FinishDynamicImportSuccess( | |
1079 Local<Context> context, Local<Promise> promise, Local<Module> module); | |
1080 | |
1081 /** | |
1082 * Rejects the promise with the given exception. | |
1083 */ | |
1084 static V8_WARN_UNUSED_RESULT bool FinishDynamicImportFailure( | |
1085 Local<Context> context, Local<Promise> promise, Local<Value> exception); | |
1073 }; | 1086 }; |
1074 | 1087 |
1075 /** | 1088 /** |
1076 * A compiled JavaScript script, tied to a Context which was active when the | 1089 * A compiled JavaScript script, tied to a Context which was active when the |
1077 * script was compiled. | 1090 * script was compiled. |
1078 */ | 1091 */ |
1079 class V8_EXPORT Script { | 1092 class V8_EXPORT Script { |
1080 public: | 1093 public: |
1081 /** | 1094 /** |
1082 * A shorthand for ScriptCompiler::Compile(). | 1095 * A shorthand for ScriptCompiler::Compile(). |
(...skipping 4699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5782 kAllocationActionAllocate = 1 << 0, | 5795 kAllocationActionAllocate = 1 << 0, |
5783 kAllocationActionFree = 1 << 1, | 5796 kAllocationActionFree = 1 << 1, |
5784 kAllocationActionAll = kAllocationActionAllocate | kAllocationActionFree | 5797 kAllocationActionAll = kAllocationActionAllocate | kAllocationActionFree |
5785 }; | 5798 }; |
5786 | 5799 |
5787 // --- Enter/Leave Script Callback --- | 5800 // --- Enter/Leave Script Callback --- |
5788 typedef void (*BeforeCallEnteredCallback)(Isolate*); | 5801 typedef void (*BeforeCallEnteredCallback)(Isolate*); |
5789 typedef void (*CallCompletedCallback)(Isolate*); | 5802 typedef void (*CallCompletedCallback)(Isolate*); |
5790 typedef void (*DeprecatedCallCompletedCallback)(); | 5803 typedef void (*DeprecatedCallCompletedCallback)(); |
5791 | 5804 |
5805 typedef void (*HostImportModuleDynamicallyCallback)(Isolate* isolate, | |
5806 Local<String> referrer, | |
5807 Local<String> specifier, | |
5808 Local<Promise> promise); | |
gsathya
2017/03/22 03:08:34
Jochen --
The embedder should not tamper with the
| |
5809 | |
5792 /** | 5810 /** |
5793 * PromiseHook with type kInit is called when a new promise is | 5811 * PromiseHook with type kInit is called when a new promise is |
5794 * created. When a new promise is created as part of the chain in the | 5812 * created. When a new promise is created as part of the chain in the |
5795 * case of Promise.then or in the intermediate promises created by | 5813 * case of Promise.then or in the intermediate promises created by |
5796 * Promise.{race, all}/AsyncFunctionAwait, we pass the parent promise | 5814 * Promise.{race, all}/AsyncFunctionAwait, we pass the parent promise |
5797 * otherwise we pass undefined. | 5815 * otherwise we pass undefined. |
5798 * | 5816 * |
5799 * PromiseHook with type kResolve is called at the beginning of | 5817 * PromiseHook with type kResolve is called at the beginning of |
5800 * resolve or reject function defined by CreateResolvingFunctions. | 5818 * resolve or reject function defined by CreateResolvingFunctions. |
5801 * | 5819 * |
(...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6335 struct CreateParams { | 6353 struct CreateParams { |
6336 CreateParams() | 6354 CreateParams() |
6337 : entry_hook(nullptr), | 6355 : entry_hook(nullptr), |
6338 code_event_handler(nullptr), | 6356 code_event_handler(nullptr), |
6339 snapshot_blob(nullptr), | 6357 snapshot_blob(nullptr), |
6340 counter_lookup_callback(nullptr), | 6358 counter_lookup_callback(nullptr), |
6341 create_histogram_callback(nullptr), | 6359 create_histogram_callback(nullptr), |
6342 add_histogram_sample_callback(nullptr), | 6360 add_histogram_sample_callback(nullptr), |
6343 array_buffer_allocator(nullptr), | 6361 array_buffer_allocator(nullptr), |
6344 external_references(nullptr), | 6362 external_references(nullptr), |
6345 allow_atomics_wait(true) {} | 6363 allow_atomics_wait(true), |
6364 host_import_module_dynamically_callback_(nullptr) {} | |
6346 | 6365 |
6347 /** | 6366 /** |
6348 * The optional entry_hook allows the host application to provide the | 6367 * The optional entry_hook allows the host application to provide the |
6349 * address of a function that's invoked on entry to every V8-generated | 6368 * address of a function that's invoked on entry to every V8-generated |
6350 * function. Note that entry_hook is invoked at the very start of each | 6369 * function. Note that entry_hook is invoked at the very start of each |
6351 * generated function. | 6370 * generated function. |
6352 * An entry_hook can only be provided in no-snapshot builds; in snapshot | 6371 * An entry_hook can only be provided in no-snapshot builds; in snapshot |
6353 * builds it must be nullptr. | 6372 * builds it must be nullptr. |
6354 */ | 6373 */ |
6355 FunctionEntryHook entry_hook; | 6374 FunctionEntryHook entry_hook; |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
6398 * deserialization. This array and its content must stay valid for the | 6417 * deserialization. This array and its content must stay valid for the |
6399 * entire lifetime of the isolate. | 6418 * entire lifetime of the isolate. |
6400 */ | 6419 */ |
6401 intptr_t* external_references; | 6420 intptr_t* external_references; |
6402 | 6421 |
6403 /** | 6422 /** |
6404 * Whether calling Atomics.wait (a function that may block) is allowed in | 6423 * Whether calling Atomics.wait (a function that may block) is allowed in |
6405 * this isolate. | 6424 * this isolate. |
6406 */ | 6425 */ |
6407 bool allow_atomics_wait; | 6426 bool allow_atomics_wait; |
6427 | |
6428 /** | |
6429 * This is an unfinished experimental feature, and is only exposed | |
6430 * here for internal testing purposes. DO NOT USE. | |
6431 * | |
6432 * This specifies the callback called by the upcoming dynamic | |
6433 * import() language feature to load modules. | |
6434 */ | |
6435 HostImportModuleDynamicallyCallback | |
6436 host_import_module_dynamically_callback_; | |
6408 }; | 6437 }; |
6409 | 6438 |
6410 | 6439 |
6411 /** | 6440 /** |
6412 * Stack-allocated class which sets the isolate for all operations | 6441 * Stack-allocated class which sets the isolate for all operations |
6413 * executed within a local scope. | 6442 * executed within a local scope. |
6414 */ | 6443 */ |
6415 class V8_EXPORT Scope { | 6444 class V8_EXPORT Scope { |
6416 public: | 6445 public: |
6417 explicit Scope(Isolate* isolate) : isolate_(isolate) { | 6446 explicit Scope(Isolate* isolate) : isolate_(isolate) { |
(...skipping 3418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
9836 */ | 9865 */ |
9837 | 9866 |
9838 | 9867 |
9839 } // namespace v8 | 9868 } // namespace v8 |
9840 | 9869 |
9841 | 9870 |
9842 #undef TYPE_CHECK | 9871 #undef TYPE_CHECK |
9843 | 9872 |
9844 | 9873 |
9845 #endif // INCLUDE_V8_H_ | 9874 #endif // INCLUDE_V8_H_ |
OLD | NEW |