Also add a bigger warning to the header comment for the Maybe version.
R=jochen@chromium.org
Review URL: https://codereview.chromium.org/
1276353003
Cr-Commit-Position: refs/heads/master@{#30137}
/**
* Compile an ES6 module.
*
- * This is an experimental feature.
+ * This is an unfinished experimental feature, and is only exposed
+ * here for internal testing purposes.
+ * Only parsing works at the moment. Do not use.
*
* TODO(adamk): Script is likely the wrong return value for this;
* should return some new Module type.
*/
- static V8_DEPRECATE_SOON(
- "Use maybe version",
- Local<Script> CompileModule(Isolate* isolate, Source* source,
- CompileOptions options = kNoCompileOptions));
static V8_WARN_UNUSED_RESULT MaybeLocal<Script> CompileModule(
Local<Context> context, Source* source,
CompileOptions options = kNoCompileOptions);
}
-Local<Script> ScriptCompiler::CompileModule(Isolate* v8_isolate, Source* source,
- CompileOptions options) {
- auto context = v8_isolate->GetCurrentContext();
- RETURN_TO_LOCAL_UNCHECKED(CompileModule(context, source, options), Script);
-}
-
-
class IsIdentifierHelper {
public:
IsIdentifierHelper() : is_identifier_(false), first_char_(true) {}
}
-// Compiles source as an ES6 module.
-static inline v8::Local<v8::Value> CompileRunModule(const char* source) {
- v8::ScriptCompiler::Source script_source(v8_str(source));
- return v8::ScriptCompiler::CompileModule(v8::Isolate::GetCurrent(),
- &script_source)->Run();
-}
-
-
static inline v8::Local<v8::Value> CompileRun(v8::Local<v8::String> source) {
return v8::Script::Compile(source)->Run();
}