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

Unified Diff: test/cctest/cctest.h

Issue 902093002: Add basic compilation support for modules (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add TODO Created 5 years, 10 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 | « src/parser.cc ('k') | test/cctest/cctest.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/cctest.h
diff --git a/test/cctest/cctest.h b/test/cctest/cctest.h
index 1d70c0e8aea4dcb773381c30eb89a012099d4fd0..e111438cdf7de109e3834dfeba6a41a1fa9a1e9c 100644
--- a/test/cctest/cctest.h
+++ b/test/cctest/cctest.h
@@ -389,6 +389,14 @@ static inline v8::Local<v8::Value> CompileRun(const char* source) {
}
+// 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();
}
« no previous file with comments | « src/parser.cc ('k') | test/cctest/cctest.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698