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

Side by Side Diff: include/v8.h

Issue 2703563002: [ESNext] Implement DynamicImportCall (Closed)
Patch Set: fix build 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/api.cc » ('j') | src/ast/ast.h » ('J')
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 1053 matching lines...) Expand 10 before | Expand all | Expand 10 after
1064 */ 1064 */
1065 V8_WARN_UNUSED_RESULT bool Instantiate(Local<Context> context, 1065 V8_WARN_UNUSED_RESULT bool Instantiate(Local<Context> context,
1066 ResolveCallback callback); 1066 ResolveCallback callback);
1067 1067
1068 /** 1068 /**
1069 * ModuleEvaluation 1069 * ModuleEvaluation
1070 * 1070 *
1071 * Returns the completion value. 1071 * Returns the completion value.
1072 */ 1072 */
1073 V8_WARN_UNUSED_RESULT MaybeLocal<Value> Evaluate(Local<Context> context); 1073 V8_WARN_UNUSED_RESULT MaybeLocal<Value> Evaluate(Local<Context> context);
1074
1075 static bool FinishDynamicImportSuccess(Local<Context> context,
adamk 2017/03/15 21:36:43 It looks like this returns false if PromiseResolve
gsathya 2017/03/16 00:59:24 Done.
1076 Local<Promise> promise,
1077 Local<Module> module);
1078
1079 static bool FinishDynamicImportFailure(Local<Context> context,
1080 Local<Promise> promise,
1081 Local<Value> exception);
1074 }; 1082 };
1075 1083
1076 /** 1084 /**
1077 * A compiled JavaScript script, tied to a Context which was active when the 1085 * A compiled JavaScript script, tied to a Context which was active when the
1078 * script was compiled. 1086 * script was compiled.
1079 */ 1087 */
1080 class V8_EXPORT Script { 1088 class V8_EXPORT Script {
1081 public: 1089 public:
1082 /** 1090 /**
1083 * A shorthand for ScriptCompiler::Compile(). 1091 * A shorthand for ScriptCompiler::Compile().
(...skipping 4696 matching lines...) Expand 10 before | Expand all | Expand 10 after
5780 kAllocationActionAllocate = 1 << 0, 5788 kAllocationActionAllocate = 1 << 0,
5781 kAllocationActionFree = 1 << 1, 5789 kAllocationActionFree = 1 << 1,
5782 kAllocationActionAll = kAllocationActionAllocate | kAllocationActionFree 5790 kAllocationActionAll = kAllocationActionAllocate | kAllocationActionFree
5783 }; 5791 };
5784 5792
5785 // --- Enter/Leave Script Callback --- 5793 // --- Enter/Leave Script Callback ---
5786 typedef void (*BeforeCallEnteredCallback)(Isolate*); 5794 typedef void (*BeforeCallEnteredCallback)(Isolate*);
5787 typedef void (*CallCompletedCallback)(Isolate*); 5795 typedef void (*CallCompletedCallback)(Isolate*);
5788 typedef void (*DeprecatedCallCompletedCallback)(); 5796 typedef void (*DeprecatedCallCompletedCallback)();
5789 5797
5798 typedef void (*HostImportModuleDynamicallyCallback)(Isolate* isolate,
5799 Local<String> referrer,
5800 Local<String> specifier,
5801 Local<Promise> promise);
adamk 2017/03/15 21:36:43 As previously discussed, can you type the Promise
5802
5790 /** 5803 /**
5791 * PromiseHook with type kInit is called when a new promise is 5804 * PromiseHook with type kInit is called when a new promise is
5792 * created. When a new promise is created as part of the chain in the 5805 * created. When a new promise is created as part of the chain in the
5793 * case of Promise.then or in the intermediate promises created by 5806 * case of Promise.then or in the intermediate promises created by
5794 * Promise.{race, all}/AsyncFunctionAwait, we pass the parent promise 5807 * Promise.{race, all}/AsyncFunctionAwait, we pass the parent promise
5795 * otherwise we pass undefined. 5808 * otherwise we pass undefined.
5796 * 5809 *
5797 * PromiseHook with type kResolve is called at the beginning of 5810 * PromiseHook with type kResolve is called at the beginning of
5798 * resolve or reject function defined by CreateResolvingFunctions. 5811 * resolve or reject function defined by CreateResolvingFunctions.
5799 * 5812 *
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after
6329 struct CreateParams { 6342 struct CreateParams {
6330 CreateParams() 6343 CreateParams()
6331 : entry_hook(nullptr), 6344 : entry_hook(nullptr),
6332 code_event_handler(nullptr), 6345 code_event_handler(nullptr),
6333 snapshot_blob(nullptr), 6346 snapshot_blob(nullptr),
6334 counter_lookup_callback(nullptr), 6347 counter_lookup_callback(nullptr),
6335 create_histogram_callback(nullptr), 6348 create_histogram_callback(nullptr),
6336 add_histogram_sample_callback(nullptr), 6349 add_histogram_sample_callback(nullptr),
6337 array_buffer_allocator(nullptr), 6350 array_buffer_allocator(nullptr),
6338 external_references(nullptr), 6351 external_references(nullptr),
6339 allow_atomics_wait(true) {} 6352 allow_atomics_wait(true),
6353 host_import_module_dynamically_callback_(nullptr) {}
6340 6354
6341 /** 6355 /**
6342 * The optional entry_hook allows the host application to provide the 6356 * The optional entry_hook allows the host application to provide the
6343 * address of a function that's invoked on entry to every V8-generated 6357 * address of a function that's invoked on entry to every V8-generated
6344 * function. Note that entry_hook is invoked at the very start of each 6358 * function. Note that entry_hook is invoked at the very start of each
6345 * generated function. 6359 * generated function.
6346 * An entry_hook can only be provided in no-snapshot builds; in snapshot 6360 * An entry_hook can only be provided in no-snapshot builds; in snapshot
6347 * builds it must be nullptr. 6361 * builds it must be nullptr.
6348 */ 6362 */
6349 FunctionEntryHook entry_hook; 6363 FunctionEntryHook entry_hook;
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
6392 * deserialization. This array and its content must stay valid for the 6406 * deserialization. This array and its content must stay valid for the
6393 * entire lifetime of the isolate. 6407 * entire lifetime of the isolate.
6394 */ 6408 */
6395 intptr_t* external_references; 6409 intptr_t* external_references;
6396 6410
6397 /** 6411 /**
6398 * Whether calling Atomics.wait (a function that may block) is allowed in 6412 * Whether calling Atomics.wait (a function that may block) is allowed in
6399 * this isolate. 6413 * this isolate.
6400 */ 6414 */
6401 bool allow_atomics_wait; 6415 bool allow_atomics_wait;
6416
6417 /**
6418 * TODO(gsathya): Write doc
6419 */
6420 HostImportModuleDynamicallyCallback
6421 host_import_module_dynamically_callback_;
6402 }; 6422 };
6403 6423
6404 6424
6405 /** 6425 /**
6406 * Stack-allocated class which sets the isolate for all operations 6426 * Stack-allocated class which sets the isolate for all operations
6407 * executed within a local scope. 6427 * executed within a local scope.
6408 */ 6428 */
6409 class V8_EXPORT Scope { 6429 class V8_EXPORT Scope {
6410 public: 6430 public:
6411 explicit Scope(Isolate* isolate) : isolate_(isolate) { 6431 explicit Scope(Isolate* isolate) : isolate_(isolate) {
(...skipping 3419 matching lines...) Expand 10 before | Expand all | Expand 10 after
9831 */ 9851 */
9832 9852
9833 9853
9834 } // namespace v8 9854 } // namespace v8
9835 9855
9836 9856
9837 #undef TYPE_CHECK 9857 #undef TYPE_CHECK
9838 9858
9839 9859
9840 #endif // INCLUDE_V8_H_ 9860 #endif // INCLUDE_V8_H_
OLDNEW
« no previous file with comments | « no previous file | src/api.cc » ('j') | src/ast/ast.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698