Skip to content

Commit d51000e

Browse files
committed
more tests
1 parent fa4ca0c commit d51000e

File tree

1 file changed

+49
-28
lines changed

1 file changed

+49
-28
lines changed

src/test/java/org/htmlunit/javascript/ArgumentsTest.java

Lines changed: 49 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1774,7 +1774,7 @@ public void argumentsToStringStrict() throws Exception {
17741774
* @throws Exception if the test fails
17751775
*/
17761776
@Test
1777-
@Alerts({"undefined", "undefined", "test"})
1777+
@Alerts({"undefined", "false", "undefined", "false", "test"})
17781778
public void argumentsCaller() throws Exception {
17791779
final String html = DOCTYPE_HTML
17801780
+ "<html>\n"
@@ -1788,6 +1788,7 @@ public void argumentsCaller() throws Exception {
17881788
+ " } catch(e) {\n"
17891789
+ " logEx(e);\n"
17901790
+ " }\n"
1791+
+ " log(Object.keys(arguments).includes('caller'));\n"
17911792
+ " test1('hi');\n"
17921793
+ " }\n"
17931794

@@ -1797,6 +1798,7 @@ public void argumentsCaller() throws Exception {
17971798
+ " } catch(e) {\n"
17981799
+ " logEx(e);\n"
17991800
+ " }\n"
1801+
+ " log(Object.keys(arguments).includes('caller'));\n"
18001802

18011803
+ " try {\n"
18021804
+ " log(arguments.callee.caller.name);\n"
@@ -1816,7 +1818,7 @@ public void argumentsCaller() throws Exception {
18161818
* @throws Exception if the test fails
18171819
*/
18181820
@Test
1819-
@Alerts({"undefined", "undefined", "TypeError"})
1821+
@Alerts({"undefined", "false", "undefined", "false", "TypeError"})
18201822
public void argumentsCallerStrictScript() throws Exception {
18211823
final String html = DOCTYPE_HTML
18221824
+ "<html>\n"
@@ -1831,6 +1833,7 @@ public void argumentsCallerStrictScript() throws Exception {
18311833
+ " } catch(e) {\n"
18321834
+ " logEx(e);\n"
18331835
+ " }\n"
1836+
+ " log(Object.keys(arguments).includes('caller'));\n"
18341837
+ " test1('hi');\n"
18351838
+ " }\n"
18361839

@@ -1840,6 +1843,7 @@ public void argumentsCallerStrictScript() throws Exception {
18401843
+ " } catch(e) {\n"
18411844
+ " logEx(e);\n"
18421845
+ " }\n"
1846+
+ " log(Object.keys(arguments).includes('caller'));\n"
18431847

18441848
+ " try {\n"
18451849
+ " log(arguments.callee.caller.name);\n"
@@ -1859,11 +1863,11 @@ public void argumentsCallerStrictScript() throws Exception {
18591863
* @throws Exception if the test fails
18601864
*/
18611865
@Test
1862-
@Alerts({"undefined", "undefined", "null"})
1863-
@HtmlUnitNYI(CHROME = {"undefined", "undefined", "undefined"},
1864-
EDGE = {"undefined", "undefined", "undefined"},
1865-
FF = {"undefined", "undefined", "undefined"},
1866-
FF_ESR = {"undefined", "undefined", "undefined"})
1866+
@Alerts({"undefined", "false", "undefined", "false", "null"})
1867+
@HtmlUnitNYI(CHROME = {"undefined", "false", "undefined", "false", "undefined"},
1868+
EDGE = {"undefined", "false", "undefined", "false", "undefined"},
1869+
FF = {"undefined", "false", "undefined", "false", "undefined"},
1870+
FF_ESR = {"undefined", "false", "undefined", "false", "undefined"})
18671871
public void argumentsCallerStrictParentFoo() throws Exception {
18681872
final String html = DOCTYPE_HTML
18691873
+ "<html>\n"
@@ -1878,6 +1882,7 @@ public void argumentsCallerStrictParentFoo() throws Exception {
18781882
+ " } catch(e) {\n"
18791883
+ " logEx(e);\n"
18801884
+ " }\n"
1885+
+ " log(Object.keys(arguments).includes('caller'));\n"
18811886
+ " test1('hi');\n"
18821887
+ " }\n"
18831888

@@ -1887,6 +1892,7 @@ public void argumentsCallerStrictParentFoo() throws Exception {
18871892
+ " } catch(e) {\n"
18881893
+ " logEx(e);\n"
18891894
+ " }\n"
1895+
+ " log(Object.keys(arguments).includes('caller'));\n"
18901896

18911897
+ " try {\n"
18921898
+ " log(arguments.callee.caller);\n"
@@ -1906,7 +1912,7 @@ public void argumentsCallerStrictParentFoo() throws Exception {
19061912
* @throws Exception if the test fails
19071913
*/
19081914
@Test
1909-
@Alerts({"undefined", "undefined", "TypeError"})
1915+
@Alerts({"undefined", "false", "undefined", "false", "TypeError"})
19101916
public void argumentsCallerStrictChildFoo() throws Exception {
19111917
final String html = DOCTYPE_HTML
19121918
+ "<html>\n"
@@ -1920,6 +1926,7 @@ public void argumentsCallerStrictChildFoo() throws Exception {
19201926
+ " } catch(e) {\n"
19211927
+ " logEx(e);\n"
19221928
+ " }\n"
1929+
+ " log(Object.keys(arguments).includes('caller'));\n"
19231930
+ " test1('hi');\n"
19241931
+ " }\n"
19251932

@@ -1930,6 +1937,7 @@ public void argumentsCallerStrictChildFoo() throws Exception {
19301937
+ " } catch(e) {\n"
19311938
+ " logEx(e);\n"
19321939
+ " }\n"
1940+
+ " log(Object.keys(arguments).includes('caller'));\n"
19331941

19341942
+ " try {\n"
19351943
+ " log(arguments.callee.caller);\n"
@@ -1949,11 +1957,11 @@ public void argumentsCallerStrictChildFoo() throws Exception {
19491957
* @throws Exception if the test fails
19501958
*/
19511959
@Test
1952-
@Alerts({"null", "null", "test", "test"})
1953-
@HtmlUnitNYI(CHROME = {"undefined", "undefined", "test", "test"},
1954-
EDGE = {"undefined", "undefined", "test", "test"},
1955-
FF = {"undefined", "undefined", "test", "test"},
1956-
FF_ESR = {"undefined", "undefined", "test", "test"})
1960+
@Alerts({"null", "false", "null", "false", "test", "false", "test", "false"})
1961+
@HtmlUnitNYI(CHROME = {"undefined", "false", "undefined", "false", "test", "false", "test", "false"},
1962+
EDGE = {"undefined", "false", "undefined", "false", "test", "false", "test", "false"},
1963+
FF = {"undefined", "false", "undefined", "false", "test", "false", "test", "false"},
1964+
FF_ESR = {"undefined", "false", "undefined", "false", "test", "false", "test", "false"})
19571965
public void caller() throws Exception {
19581966
final String html = DOCTYPE_HTML
19591967
+ "<html>\n"
@@ -1967,6 +1975,7 @@ public void caller() throws Exception {
19671975
+ " } catch(e) {\n"
19681976
+ " logEx(e);\n"
19691977
+ " }\n"
1978+
+ " log(Object.keys(test).includes('caller'));\n"
19701979
+ " test1('hi');\n"
19711980
+ " }\n"
19721981

@@ -1976,18 +1985,21 @@ public void caller() throws Exception {
19761985
+ " } catch(e) {\n"
19771986
+ " logEx(e);\n"
19781987
+ " }\n"
1988+
+ " log(Object.keys(test).includes('caller'));\n"
19791989

19801990
+ " try {\n"
19811991
+ " log(test1.caller.name);\n"
19821992
+ " } catch(e) {\n"
19831993
+ " logEx(e);\n"
19841994
+ " }\n"
1995+
+ " log(Object.keys(test1).includes('caller'));\n"
19851996

19861997
+ " try {\n"
19871998
+ " log(arguments.callee.caller.name);\n"
19881999
+ " } catch(e) {\n"
19892000
+ " logEx(e);\n"
19902001
+ " }\n"
2002+
+ " log(Object.keys(arguments.callee).includes('caller'));\n"
19912003
+ " }\n"
19922004

19932005
+ " test();\n"
@@ -2001,11 +2013,11 @@ public void caller() throws Exception {
20012013
* @throws Exception if the test fails
20022014
*/
20032015
@Test
2004-
@Alerts({"TypeError", "TypeError", "TypeError", "TypeError"})
2005-
@HtmlUnitNYI(CHROME = {"undefined", "undefined", "TypeError", "TypeError"},
2006-
EDGE = {"undefined", "undefined", "TypeError", "TypeError"},
2007-
FF = {"undefined", "undefined", "TypeError", "TypeError"},
2008-
FF_ESR = {"undefined", "undefined", "TypeError", "TypeError"})
2016+
@Alerts({"TypeError", "false", "TypeError", "false", "TypeError", "false", "TypeError"})
2017+
@HtmlUnitNYI(CHROME = {"undefined", "false", "undefined", "false", "TypeError", "false", "TypeError"},
2018+
EDGE = {"undefined", "false", "undefined", "false", "TypeError", "false", "TypeError"},
2019+
FF = {"undefined", "false", "undefined", "false", "TypeError", "false", "TypeError"},
2020+
FF_ESR = {"undefined", "false", "undefined", "false", "TypeError", "false", "TypeError"})
20092021
public void callerStrictScript() throws Exception {
20102022
final String html = DOCTYPE_HTML
20112023
+ "<html>\n"
@@ -2020,6 +2032,7 @@ public void callerStrictScript() throws Exception {
20202032
+ " } catch(e) {\n"
20212033
+ " logEx(e);\n"
20222034
+ " }\n"
2035+
+ " log(Object.keys(test).includes('caller'));\n"
20232036
+ " test1('hi');\n"
20242037
+ " }\n"
20252038

@@ -2029,12 +2042,14 @@ public void callerStrictScript() throws Exception {
20292042
+ " } catch(e) {\n"
20302043
+ " logEx(e);\n"
20312044
+ " }\n"
2045+
+ " log(Object.keys(test).includes('caller'));\n"
20322046

20332047
+ " try {\n"
20342048
+ " log(test1.caller.name);\n"
20352049
+ " } catch(e) {\n"
20362050
+ " logEx(e);\n"
20372051
+ " }\n"
2052+
+ " log(Object.keys(test1).includes('caller'));\n"
20382053

20392054
+ " try {\n"
20402055
+ " log(arguments.callee.caller.name);\n"
@@ -2054,11 +2069,11 @@ public void callerStrictScript() throws Exception {
20542069
* @throws Exception if the test fails
20552070
*/
20562071
@Test
2057-
@Alerts({"TypeError", "TypeError", "null", "null"})
2058-
@HtmlUnitNYI(CHROME = {"undefined", "undefined", "undefined", "undefined"},
2059-
EDGE = {"undefined", "undefined", "undefined", "undefined"},
2060-
FF = {"undefined", "undefined", "undefined", "undefined"},
2061-
FF_ESR = {"undefined", "undefined", "undefined", "undefined"})
2072+
@Alerts({"TypeError", "false", "TypeError", "false", "null", "false", "null"})
2073+
@HtmlUnitNYI(CHROME = {"undefined", "false", "undefined", "false", "undefined", "false", "undefined"},
2074+
EDGE = {"undefined", "false", "undefined", "false", "undefined", "false", "undefined"},
2075+
FF = {"undefined", "false", "undefined", "false", "undefined", "false", "undefined"},
2076+
FF_ESR = {"undefined", "false", "undefined", "false", "undefined", "false", "undefined"})
20622077
public void callerStrictParentFoo() throws Exception {
20632078
final String html = DOCTYPE_HTML
20642079
+ "<html>\n"
@@ -2073,6 +2088,7 @@ public void callerStrictParentFoo() throws Exception {
20732088
+ " } catch(e) {\n"
20742089
+ " logEx(e);\n"
20752090
+ " }\n"
2091+
+ " log(Object.keys(test).includes('caller'));\n"
20762092
+ " test1('hi');\n"
20772093
+ " }\n"
20782094

@@ -2082,12 +2098,14 @@ public void callerStrictParentFoo() throws Exception {
20822098
+ " } catch(e) {\n"
20832099
+ " logEx(e);\n"
20842100
+ " }\n"
2101+
+ " log(Object.keys(test).includes('caller'));\n"
20852102

20862103
+ " try {\n"
20872104
+ " log(test1.caller);\n"
20882105
+ " } catch(e) {\n"
20892106
+ " logEx(e);\n"
20902107
+ " }\n"
2108+
+ " log(Object.keys(test1).includes('caller'));\n"
20912109

20922110
+ " try {\n"
20932111
+ " log(arguments.callee.caller);\n"
@@ -2107,11 +2125,11 @@ public void callerStrictParentFoo() throws Exception {
21072125
* @throws Exception if the test fails
21082126
*/
21092127
@Test
2110-
@Alerts({"null", "null", "TypeError", "TypeError"})
2111-
@HtmlUnitNYI(CHROME = {"undefined", "undefined", "TypeError", "TypeError"},
2112-
EDGE = {"undefined", "undefined", "TypeError", "TypeError"},
2113-
FF = {"undefined", "undefined", "TypeError", "TypeError"},
2114-
FF_ESR = {"undefined", "undefined", "TypeError", "TypeError"})
2128+
@Alerts({"null", "false", "null", "false", "TypeError", "false", "TypeError"})
2129+
@HtmlUnitNYI(CHROME = {"undefined", "false", "undefined", "false", "TypeError", "false", "TypeError"},
2130+
EDGE = {"undefined", "false", "undefined", "false", "TypeError", "false", "TypeError"},
2131+
FF = {"undefined", "false", "undefined", "false", "TypeError", "false", "TypeError"},
2132+
FF_ESR = {"undefined", "false", "undefined", "false", "TypeError", "false", "TypeError"})
21152133
public void callerStrictChildFoo() throws Exception {
21162134
final String html = DOCTYPE_HTML
21172135
+ "<html>\n"
@@ -2125,6 +2143,7 @@ public void callerStrictChildFoo() throws Exception {
21252143
+ " } catch(e) {\n"
21262144
+ " logEx(e);\n"
21272145
+ " }\n"
2146+
+ " log(Object.keys(test).includes('caller'));\n"
21282147
+ " test1('hi');\n"
21292148
+ " }\n"
21302149

@@ -2135,12 +2154,14 @@ public void callerStrictChildFoo() throws Exception {
21352154
+ " } catch(e) {\n"
21362155
+ " logEx(e);\n"
21372156
+ " }\n"
2157+
+ " log(Object.keys(test).includes('caller'));\n"
21382158

21392159
+ " try {\n"
21402160
+ " log(test1.caller.name);\n"
21412161
+ " } catch(e) {\n"
21422162
+ " logEx(e);\n"
21432163
+ " }\n"
2164+
+ " log(Object.keys(test1).includes('caller'));\n"
21442165

21452166
+ " try {\n"
21462167
+ " log(arguments.callee.caller);\n"

0 commit comments

Comments
 (0)