Skip to content

Commit 6506925

Browse files
committed
conditionallyCreatedFunction (issue #354)
1 parent 256925f commit 6506925

File tree

3 files changed

+23
-2
lines changed

3 files changed

+23
-2
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
<htmlunitcssparser.version>3.0.0</htmlunitcssparser.version>
2929
<htmlunitneko.version>3.1.0-SNAPSHOT</htmlunitneko.version>
30-
<htmlunitcorejs.version>3.0.0</htmlunitcorejs.version>
30+
<htmlunitcorejs.version>3.1.0-SNAPSHOT</htmlunitcorejs.version>
3131
<htmlunitxpath.version>3.0.0</htmlunitxpath.version>
3232

3333
<htmlunitdriver.version>4.8.3-SNAPSHOT</htmlunitdriver.version>

src/changes/changes.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
&lt;a href="http://code.google.com/p/googleappengine/issues/detail?id=4784"&gt; is solved.
1414
</action>
1515
<action type="fix" dev="rbri" issue="578">
16-
Calls to hasOwnProperty() and getOwnPropertyDescriptor now takes care of form elements accessable from
16+
Calls to hasOwnProperty() and getOwnPropertyDescriptor now taking care of form elements accessible from
1717
the form object.
1818
</action>
1919
<action type="fix" dev="rbri">

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

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,4 +120,25 @@ public void boundFunction_toString() throws Exception {
120120

121121
loadPageVerifyTitle2(html);
122122
}
123+
124+
/**
125+
* @throws Exception if the test fails
126+
*/
127+
@Test
128+
@Alerts("foo = undefined")
129+
public void conditionallyCreatedFunction() throws Exception {
130+
final String html
131+
= "<html><head></head>\n"
132+
+ "<body>\n"
133+
+ "<script>\n"
134+
+ LOG_TITLE_FUNCTION
135+
+ " log('foo = ' + foo);\n"
136+
+ " if (false) {\n"
137+
+ " function foo() { return 1; }\n"
138+
+ " }\n"
139+
+ "</script>\n"
140+
+ "</body></html>";
141+
142+
loadPageVerifyTitle2(html);
143+
}
123144
}

0 commit comments

Comments
 (0)