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

Unified Diff: include/v8.h

Issue 2703563002: [ESNext] Implement DynamicImportCall (Closed)
Patch Set: rebase Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/v8.h
diff --git a/include/v8.h b/include/v8.h
index 2f3c77600745b4b20482617f32995d3b20569557..6dbc8671f57cbc4a1c3594aa0db5da50a25ee5f6 100644
--- a/include/v8.h
+++ b/include/v8.h
@@ -1070,6 +1070,19 @@ class V8_EXPORT Module {
* Returns the completion value.
*/
V8_WARN_UNUSED_RESULT MaybeLocal<Value> Evaluate(Local<Context> context);
+
+ /**
+ * Resolves the promise with the namespace object of the given
+ * module.
+ */
+ static V8_WARN_UNUSED_RESULT bool FinishDynamicImportSuccess(
+ Local<Context> context, Local<Promise> promise, Local<Module> module);
+
+ /**
+ * Rejects the promise with the given exception.
+ */
+ static V8_WARN_UNUSED_RESULT bool FinishDynamicImportFailure(
+ Local<Context> context, Local<Promise> promise, Local<Value> exception);
};
/**
@@ -5789,6 +5802,11 @@ typedef void (*BeforeCallEnteredCallback)(Isolate*);
typedef void (*CallCompletedCallback)(Isolate*);
typedef void (*DeprecatedCallCompletedCallback)();
+typedef void (*HostImportModuleDynamicallyCallback)(Isolate* isolate,
+ Local<String> referrer,
+ Local<String> specifier,
+ Local<Promise> promise);
gsathya 2017/03/22 03:08:34 Jochen -- The embedder should not tamper with the
+
/**
* PromiseHook with type kInit is called when a new promise is
* created. When a new promise is created as part of the chain in the
@@ -6342,7 +6360,8 @@ class V8_EXPORT Isolate {
add_histogram_sample_callback(nullptr),
array_buffer_allocator(nullptr),
external_references(nullptr),
- allow_atomics_wait(true) {}
+ allow_atomics_wait(true),
+ host_import_module_dynamically_callback_(nullptr) {}
/**
* The optional entry_hook allows the host application to provide the
@@ -6405,6 +6424,16 @@ class V8_EXPORT Isolate {
* this isolate.
*/
bool allow_atomics_wait;
+
+ /**
+ * This is an unfinished experimental feature, and is only exposed
+ * here for internal testing purposes. DO NOT USE.
+ *
+ * This specifies the callback called by the upcoming dynamic
+ * import() language feature to load modules.
+ */
+ HostImportModuleDynamicallyCallback
+ host_import_module_dynamically_callback_;
};
« no previous file with comments | « no previous file | src/api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698