| Index: test/cctest/test-func-name-inference.cc
|
| diff --git a/test/cctest/test-func-name-inference.cc b/test/cctest/test-func-name-inference.cc
|
| index a86dfd28a1aab6ae39c307cab87df1d403f04fa5..dcc6272a39ce834787c58d532daf80e39d578370 100644
|
| --- a/test/cctest/test-func-name-inference.cc
|
| +++ b/test/cctest/test-func-name-inference.cc
|
| @@ -258,6 +258,57 @@ TEST(MultipleFuncsInLiteral) {
|
| }
|
|
|
|
|
| +TEST(AnonymousInAnonymousClosure1) {
|
| + CcTest::InitializeVM();
|
| + v8::HandleScope scope(CcTest::isolate());
|
| +
|
| + v8::Handle<v8::Script> script = Compile(
|
| + "(function() {\n"
|
| + " (function() {\n"
|
| + " var a = 1;\n"
|
| + " return;\n"
|
| + " })();\n"
|
| + " var b = function() {\n"
|
| + " var c = 1;\n"
|
| + " return;\n"
|
| + " };\n"
|
| + "})();");
|
| + CheckFunctionName(script, "return", "");
|
| +}
|
| +
|
| +
|
| +TEST(AnonymousInAnonymousClosure2) {
|
| + CcTest::InitializeVM();
|
| + v8::HandleScope scope(CcTest::isolate());
|
| +
|
| + v8::Handle<v8::Script> script = Compile(
|
| + "(function() {\n"
|
| + " (function() {\n"
|
| + " var a = 1;\n"
|
| + " return;\n"
|
| + " })();\n"
|
| + " var c = 1;\n"
|
| + "})();");
|
| + CheckFunctionName(script, "return", "");
|
| +}
|
| +
|
| +
|
| +TEST(NamedInAnonymousClosure) {
|
| + CcTest::InitializeVM();
|
| + v8::HandleScope scope(CcTest::isolate());
|
| +
|
| + v8::Handle<v8::Script> script = Compile(
|
| + "var foo = function() {\n"
|
| + " (function named() {\n"
|
| + " var a = 1;\n"
|
| + " })();\n"
|
| + " var c = 1;\n"
|
| + " return;\n"
|
| + "};");
|
| + CheckFunctionName(script, "return", "foo");
|
| +}
|
| +
|
| +
|
| // See http://code.google.com/p/v8/issues/detail?id=380
|
| TEST(Issue380) {
|
| CcTest::InitializeVM();
|
|
|