| Index: test/cctest/interpreter/test-interpreter.cc
|
| diff --git a/test/cctest/interpreter/test-interpreter.cc b/test/cctest/interpreter/test-interpreter.cc
|
| index 7343d0818269cf8865a0cb32fcc52094e06b861b..bed394b1f3ca5d5fa977b203d5b8be9952752ba1 100644
|
| --- a/test/cctest/interpreter/test-interpreter.cc
|
| +++ b/test/cctest/interpreter/test-interpreter.cc
|
| @@ -1553,3 +1553,20 @@ TEST(InterpreterCallRuntime) {
|
| Handle<Object> return_val = callable().ToHandleChecked();
|
| CHECK_EQ(Smi::cast(*return_val), Smi::FromInt(55));
|
| }
|
| +
|
| +
|
| +TEST(InterpreterFunctionLiteral) {
|
| + HandleAndZoneScope handles;
|
| +
|
| + // Test calling a function literal.
|
| + std::string source(
|
| + "function " + InterpreterTester::function_name() + "(a) {\n"
|
| + " return (function(x){ return x + 2; })(a);\n"
|
| + "}");
|
| + InterpreterTester tester(handles.main_isolate(), source.c_str());
|
| + auto callable = tester.GetCallable<Handle<Object>>();
|
| +
|
| + Handle<i::Object> return_val = callable(
|
| + Handle<Smi>(Smi::FromInt(3), handles.main_isolate())).ToHandleChecked();
|
| + CHECK_EQ(Smi::cast(*return_val), Smi::FromInt(5));
|
| +}
|
|
|