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

Unified Diff: test/cctest/test-func-name-inference.cc

Issue 2488193003: Generate inferred names for es6 class functions (Closed)
Patch Set: git cl format Created 4 years, 1 month 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/parsing/parser.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 4b16c031d9bceb7cc058b8b872e2775f74f1fb0e..8c43bbfa54e285ebb1ca6d38f490347f32980d55 100644
--- a/test/cctest/test-func-name-inference.cc
+++ b/test/cctest/test-func-name-inference.cc
@@ -141,6 +141,19 @@ TEST(LocalVar) {
CheckFunctionName(script, "return 2", "fun2");
}
+TEST(ObjectProperty) {
+ CcTest::InitializeVM();
+ v8::HandleScope scope(CcTest::isolate());
+
+ v8::Local<v8::Script> script =
+ Compile(CcTest::isolate(),
+ "var obj = {\n"
+ " fun1: function() { return 1; },\n"
+ " fun2: class { constructor() { return 2; } }\n"
+ "}");
+ CheckFunctionName(script, "return 1", "obj.fun1");
+ CheckFunctionName(script, "return 2", "obj.fun2");
+}
TEST(InConstructor) {
CcTest::InitializeVM();
« no previous file with comments | « src/parsing/parser.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698