From a18b797fd96730bc9407d27195fac66f44865004 Mon Sep 17 00:00:00 2001 From: adamk Date: Tue, 10 Feb 2015 11:11:44 -0800 Subject: [PATCH] Enable compiling mjsunit tests as ES6 modules Adding the line "// MODULE" to an mjsunit file will now cause run-tests.py to prefix the test case with "--module" in the d8 commandline. d8 has itself been updated to treat files preceded with "--module" as modules (that is, it compiles them with ScriptCompiler::CompileModule, and turns on --harmony-modules). Review URL: https://codereview.chromium.org/902263002 Cr-Commit-Position: refs/heads/master@{#26555} --- src/d8.cc | 156 ++++++++++++--------- src/d8.h | 16 ++- test/cctest/cctest.gyp | 1 - test/cctest/test-modules.cc | 25 ---- .../{module-parsing.js => module-parsing-eval.js} | 0 test/mjsunit/harmony/modules.js | 8 ++ test/mjsunit/testcfg.py | 4 + 7 files changed, 109 insertions(+), 101 deletions(-) delete mode 100644 test/cctest/test-modules.cc rename test/mjsunit/harmony/{module-parsing.js => module-parsing-eval.js} (100%) create mode 100644 test/mjsunit/harmony/modules.js diff --git a/src/d8.cc b/src/d8.cc index 6d2067f..41b5fa7 100644 --- a/src/d8.cc +++ b/src/d8.cc @@ -225,14 +225,17 @@ ScriptCompiler::CachedData* CompileForCachedData( // Compile a string within the current v8 context. -Local Shell::CompileString( +Local