| Index: test/cctest/test-modules.cc
|
| diff --git a/test/cctest/test-modules.cc b/test/cctest/test-modules.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..fe494bbd35d2a30803afb7b656cc3895c1a7fb0b
|
| --- /dev/null
|
| +++ b/test/cctest/test-modules.cc
|
| @@ -0,0 +1,25 @@
|
| +// Copyright 2015 the V8 project authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "test/cctest/cctest.h"
|
| +
|
| +TEST(ModuleCompilation) {
|
| + v8::internal::FLAG_harmony_modules = true;
|
| + v8::Isolate* isolate = CcTest::isolate();
|
| + v8::HandleScope handle_scope(isolate);
|
| + LocalContext context;
|
| +
|
| + CompileRun(
|
| + "var data = [];"
|
| + "function store(thing) {"
|
| + " data.push(thing);"
|
| + "}");
|
| +
|
| + CompileRunModule(
|
| + "export let a = 42;"
|
| + "store(a)");
|
| +
|
| + CHECK_EQ(1, CompileRun("data.length")->Int32Value());
|
| + CHECK_EQ(42, CompileRun("data[0]")->Int32Value());
|
| +}
|
|
|