@@ -326,7 +326,6 @@ public void boundWithArg() throws Exception {
326326 loadPageVerifyTitle2 (html );
327327 }
328328
329-
330329 /**
331330 * @throws Exception if the test fails
332331 */
@@ -348,4 +347,35 @@ public void bound() throws Exception {
348347
349348 loadPageVerifyTitle2 (html );
350349 }
350+
351+ /**
352+ * @throws Exception if the test fails
353+ */
354+ @ Test
355+ @ Alerts ({"f1" , "f2" , "f3" , "f4" , "f5" ,
356+ "f6" , "g" , "3" , "[foo]" , "" })
357+ public void name () throws Exception {
358+ final String html = DOCTYPE_HTML
359+ + "<html><head></head>\n "
360+ + "<body>\n "
361+ + "<script>\n "
362+ + LOG_TITLE_FUNCTION
363+
364+ + "let f1 = function() {}; log(f1.name);\n "
365+ + "let f2= () => {}; log(f2.name);\n "
366+ + "let f3 = function() {}; log(f3.name);\n "
367+ + "let f4 = () => {}; log(f4.name);\n "
368+ + "let f5 = function() {}; log(f5.name);\n "
369+
370+ + "let f6 = () => {}; log(f6.name);\n "
371+ + "let f7 = function g() {}; log(f7.name);\n "
372+ + "let f8 = { [1 + 2]() {} }; log(f8['3'].name);\n "
373+ + "let s = Symbol('foo'); let f9 = { [s]() {} }; log(f9[s].name);\n "
374+ + "let s2 = Symbol(); f10 = { [s2]() {} }; log(f10[s2].name);\n "
375+
376+ + "</script>\n "
377+ + "</body></html>" ;
378+
379+ loadPageVerifyTitle2 (html );
380+ }
351381}
0 commit comments