Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(19)

Side by Side Diff: include/v8.h

Issue 2703563002: [ESNext] Implement DynamicImportCall (Closed)
Patch Set: rebase Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/api.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1088 matching lines...) Expand 10 before | Expand all | Expand 10 after
1099 1099
1100 /** 1100 /**
1101 * ModuleEvaluation 1101 * ModuleEvaluation
1102 * 1102 *
1103 * Returns the completion value. 1103 * Returns the completion value.
1104 */ 1104 */
1105 V8_WARN_UNUSED_RESULT MaybeLocal<Value> Evaluate(Local<Context> context); 1105 V8_WARN_UNUSED_RESULT MaybeLocal<Value> Evaluate(Local<Context> context);
1106 }; 1106 };
1107 1107
1108 /** 1108 /**
1109 * This is an unfinished experimental feature, and is only exposed
1110 * here for internal testing purposes. DO NOT USE.
1111 *
1112 * A compiled JavaScript module.
1113 */
1114 class V8_EXPORT DynamicImportResult {
1115 public:
1116 /**
1117 * Resolves the promise with the namespace object of the given
1118 * module.
1119 */
1120 V8_WARN_UNUSED_RESULT bool FinishDynamicImportSuccess(Local<Context> context,
1121 Local<Module> module);
1122
1123 /**
1124 * Rejects the promise with the given exception.
1125 */
1126 V8_WARN_UNUSED_RESULT bool FinishDynamicImportFailure(Local<Context> context,
1127 Local<Value> exception);
1128 };
1129
1130 /**
1109 * A compiled JavaScript script, tied to a Context which was active when the 1131 * A compiled JavaScript script, tied to a Context which was active when the
1110 * script was compiled. 1132 * script was compiled.
1111 */ 1133 */
1112 class V8_EXPORT Script { 1134 class V8_EXPORT Script {
1113 public: 1135 public:
1114 /** 1136 /**
1115 * A shorthand for ScriptCompiler::Compile(). 1137 * A shorthand for ScriptCompiler::Compile().
1116 */ 1138 */
1117 static V8_DEPRECATE_SOON( 1139 static V8_DEPRECATE_SOON(
1118 "Use maybe version", 1140 "Use maybe version",
(...skipping 4823 matching lines...) Expand 10 before | Expand all | Expand 10 after
5942 kAllocationActionFree = 1 << 1, 5964 kAllocationActionFree = 1 << 1,
5943 kAllocationActionAll = kAllocationActionAllocate | kAllocationActionFree 5965 kAllocationActionAll = kAllocationActionAllocate | kAllocationActionFree
5944 }; 5966 };
5945 5967
5946 // --- Enter/Leave Script Callback --- 5968 // --- Enter/Leave Script Callback ---
5947 typedef void (*BeforeCallEnteredCallback)(Isolate*); 5969 typedef void (*BeforeCallEnteredCallback)(Isolate*);
5948 typedef void (*CallCompletedCallback)(Isolate*); 5970 typedef void (*CallCompletedCallback)(Isolate*);
5949 typedef void (*DeprecatedCallCompletedCallback)(); 5971 typedef void (*DeprecatedCallCompletedCallback)();
5950 5972
5951 /** 5973 /**
5974 * HostImportDynamicallyCallback is called when we require the
5975 * embedder to load a module. This is used as part of the dynamic
5976 * import syntax. The behavior of this callback is not specified in
5977 * EcmaScript.
5978 *
5979 * The referrer is the name of the file which calls the dynamic
5980 * import. The referrer can be used to resolve the module location.
5981 *
5982 * The specifier is the name of the module that should be imported.
5983 *
5984 * The DynamicImportResult object is used to signal success or failure
5985 * by calling it's respective methods.
5986 *
5987 */
5988 typedef void (*HostImportModuleDynamicallyCallback)(
5989 Isolate* isolate, Local<String> referrer, Local<String> specifier,
5990 Local<DynamicImportResult> result);
5991
5992 /**
5952 * PromiseHook with type kInit is called when a new promise is 5993 * PromiseHook with type kInit is called when a new promise is
5953 * created. When a new promise is created as part of the chain in the 5994 * created. When a new promise is created as part of the chain in the
5954 * case of Promise.then or in the intermediate promises created by 5995 * case of Promise.then or in the intermediate promises created by
5955 * Promise.{race, all}/AsyncFunctionAwait, we pass the parent promise 5996 * Promise.{race, all}/AsyncFunctionAwait, we pass the parent promise
5956 * otherwise we pass undefined. 5997 * otherwise we pass undefined.
5957 * 5998 *
5958 * PromiseHook with type kResolve is called at the beginning of 5999 * PromiseHook with type kResolve is called at the beginning of
5959 * resolve or reject function defined by CreateResolvingFunctions. 6000 * resolve or reject function defined by CreateResolvingFunctions.
5960 * 6001 *
5961 * PromiseHook with type kBefore is called at the beginning of the 6002 * PromiseHook with type kBefore is called at the beginning of the
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after
6488 struct CreateParams { 6529 struct CreateParams {
6489 CreateParams() 6530 CreateParams()
6490 : entry_hook(nullptr), 6531 : entry_hook(nullptr),
6491 code_event_handler(nullptr), 6532 code_event_handler(nullptr),
6492 snapshot_blob(nullptr), 6533 snapshot_blob(nullptr),
6493 counter_lookup_callback(nullptr), 6534 counter_lookup_callback(nullptr),
6494 create_histogram_callback(nullptr), 6535 create_histogram_callback(nullptr),
6495 add_histogram_sample_callback(nullptr), 6536 add_histogram_sample_callback(nullptr),
6496 array_buffer_allocator(nullptr), 6537 array_buffer_allocator(nullptr),
6497 external_references(nullptr), 6538 external_references(nullptr),
6498 allow_atomics_wait(true) {} 6539 allow_atomics_wait(true),
6540 host_import_module_dynamically_callback_(nullptr) {}
6499 6541
6500 /** 6542 /**
6501 * The optional entry_hook allows the host application to provide the 6543 * The optional entry_hook allows the host application to provide the
6502 * address of a function that's invoked on entry to every V8-generated 6544 * address of a function that's invoked on entry to every V8-generated
6503 * function. Note that entry_hook is invoked at the very start of each 6545 * function. Note that entry_hook is invoked at the very start of each
6504 * generated function. 6546 * generated function.
6505 * An entry_hook can only be provided in no-snapshot builds; in snapshot 6547 * An entry_hook can only be provided in no-snapshot builds; in snapshot
6506 * builds it must be nullptr. 6548 * builds it must be nullptr.
6507 */ 6549 */
6508 FunctionEntryHook entry_hook; 6550 FunctionEntryHook entry_hook;
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
6551 * deserialization. This array and its content must stay valid for the 6593 * deserialization. This array and its content must stay valid for the
6552 * entire lifetime of the isolate. 6594 * entire lifetime of the isolate.
6553 */ 6595 */
6554 intptr_t* external_references; 6596 intptr_t* external_references;
6555 6597
6556 /** 6598 /**
6557 * Whether calling Atomics.wait (a function that may block) is allowed in 6599 * Whether calling Atomics.wait (a function that may block) is allowed in
6558 * this isolate. 6600 * this isolate.
6559 */ 6601 */
6560 bool allow_atomics_wait; 6602 bool allow_atomics_wait;
6603
6604 /**
6605 * This is an unfinished experimental feature, and is only exposed
6606 * here for internal testing purposes. DO NOT USE.
6607 *
6608 * This specifies the callback called by the upcoming dynamic
6609 * import() language feature to load modules.
6610 */
6611 HostImportModuleDynamicallyCallback
6612 host_import_module_dynamically_callback_;
6561 }; 6613 };
6562 6614
6563 6615
6564 /** 6616 /**
6565 * Stack-allocated class which sets the isolate for all operations 6617 * Stack-allocated class which sets the isolate for all operations
6566 * executed within a local scope. 6618 * executed within a local scope.
6567 */ 6619 */
6568 class V8_EXPORT Scope { 6620 class V8_EXPORT Scope {
6569 public: 6621 public:
6570 explicit Scope(Isolate* isolate) : isolate_(isolate) { 6622 explicit Scope(Isolate* isolate) : isolate_(isolate) {
(...skipping 3429 matching lines...) Expand 10 before | Expand all | Expand 10 after
10000 */ 10052 */
10001 10053
10002 10054
10003 } // namespace v8 10055 } // namespace v8
10004 10056
10005 10057
10006 #undef TYPE_CHECK 10058 #undef TYPE_CHECK
10007 10059
10008 10060
10009 #endif // INCLUDE_V8_H_ 10061 #endif // INCLUDE_V8_H_
OLDNEW
« no previous file with comments | « no previous file | src/api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698