| Index: include/v8.h
|
| diff --git a/include/v8.h b/include/v8.h
|
| index 816719e521de6de10587d23acd3cfd4635d7a067..c10881981abf7e1276d69184bdfa99f92121475e 100644
|
| --- a/include/v8.h
|
| +++ b/include/v8.h
|
| @@ -1070,6 +1070,26 @@ class V8_EXPORT UnboundScript {
|
| static const int kNoScriptId = 0;
|
| };
|
|
|
| +/**
|
| + * This is an unfinished experimental feature, and is only exposed
|
| + * here for internal testing purposes. DO NOT USE.
|
| + *
|
| + * A compiled JavaScript module.
|
| + */
|
| +class V8_EXPORT Module {
|
| + public:
|
| + /**
|
| + * ModuleDeclarationInstantiation
|
| + *
|
| + * Returns false if an exception occurred during instantiation.
|
| + */
|
| + V8_WARN_UNUSED_RESULT bool Instantiate(Local<Context> context);
|
| +
|
| + /**
|
| + * ModuleEvaluation
|
| + */
|
| + V8_WARN_UNUSED_RESULT MaybeLocal<Value> Evaluate(Local<Context> context);
|
| +};
|
|
|
| /**
|
| * A compiled JavaScript script, tied to a Context which was active when the
|
| @@ -1373,18 +1393,17 @@ class V8_EXPORT ScriptCompiler {
|
| static uint32_t CachedDataVersionTag();
|
|
|
| /**
|
| - * Compile an ES6 module.
|
| - *
|
| * This is an unfinished experimental feature, and is only exposed
|
| - * here for internal testing purposes.
|
| - * Only parsing works at the moment. Do not use.
|
| + * here for internal testing purposes. DO NOT USE.
|
| *
|
| - * TODO(adamk): Script is likely the wrong return value for this;
|
| - * should return some new Module type.
|
| + * Compile an ES module, returning a Module that encapsulates
|
| + * the compiled code.
|
| + *
|
| + * Corresponds to the ParseModule abstract operation in the
|
| + * ECMAScript specification.
|
| */
|
| - static V8_WARN_UNUSED_RESULT MaybeLocal<Script> CompileModule(
|
| - Local<Context> context, Source* source,
|
| - CompileOptions options = kNoCompileOptions);
|
| + static V8_WARN_UNUSED_RESULT MaybeLocal<Module> CompileModule(
|
| + Isolate* isolate, Source* source);
|
|
|
| /**
|
| * Compile a function for a given context. This is equivalent to running
|
|
|