From: <asa...@us...> - 2012-11-19 14:46:08
|
Revision: 7740 http://sourceforge.net/p/htmlunit/code/7740 Author: asashour Date: 2012-11-19 14:46:05 +0000 (Mon, 19 Nov 2012) Log Message: ----------- JavaScript: function name referenced before its declaration should be visible (IE). Modified Paths: -------------- trunk/htmlunit/src/changes/changes.xml trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/HtmlUnitContextFactory.java trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/JavaScriptEngine2Test.java Modified: trunk/htmlunit/src/changes/changes.xml =================================================================== --- trunk/htmlunit/src/changes/changes.xml 2012-11-19 13:24:25 UTC (rev 7739) +++ trunk/htmlunit/src/changes/changes.xml 2012-11-19 14:46:05 UTC (rev 7740) @@ -9,6 +9,9 @@ <body> <release version="2.12" date="???" description="Bugfixes"> <action type="fix" dev="asashour"> + JavaScript: function name referenced before its declaration should be visible (IE). + </action> + <action type="fix" dev="asashour"> JavaScript: function name referenced before its declaration should throw an exception (FF). </action> <action type="fix" dev="asashour" issue="1253"> Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java 2012-11-19 13:24:25 UTC (rev 7739) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/BrowserVersionFeatures.java 2012-11-19 14:46:05 UTC (rev 7740) @@ -858,6 +858,12 @@ JS_FUNCTION_BIND, /** + * Indicates that function is defined even before its declaration, inside a block. + */ + @BrowserFeature(@WebBrowser(IE)) + JS_FUNCTION_DECLARED_FORWARD_IN_BLOCK, + + /** * Indicates that function can be defined as * <code>function object.property() {}</code> instead of <code>object.property = function() {}</code>. */ Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/HtmlUnitContextFactory.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/HtmlUnitContextFactory.java 2012-11-19 13:24:25 UTC (rev 7739) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/HtmlUnitContextFactory.java 2012-11-19 14:46:05 UTC (rev 7740) @@ -305,6 +305,8 @@ return browserVersion_.hasFeature(BrowserVersionFeatures.JS_CONSTRUCTOR); case Context.FEATURE_HTMLUNIT_FUNCTION_OBJECT_METHOD: return browserVersion_.hasFeature(BrowserVersionFeatures.JS_FUNCTION_OBJECT_METHOD); + case Context.FEATURE_HTMLUNIT_FUNCTION_DECLARED_FORWARD_IN_BLOCK: + return browserVersion_.hasFeature(BrowserVersionFeatures.JS_FUNCTION_DECLARED_FORWARD_IN_BLOCK); default: return super.hasFeature(cx, featureIndex); } Modified: trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/JavaScriptEngine2Test.java =================================================================== --- trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/JavaScriptEngine2Test.java 2012-11-19 13:24:25 UTC (rev 7739) +++ trunk/htmlunit/src/test/java/com/gargoylesoftware/htmlunit/javascript/JavaScriptEngine2Test.java 2012-11-19 14:46:05 UTC (rev 7740) @@ -122,7 +122,6 @@ @Test @Alerts(IE = {"in goo", "in hoo", "in foo" }, FF = {"in goo", "in hoo", "foo error" }) - @NotYetImplemented(IE) public void functionDeclaredForwardInBlock() throws Exception { final String html = "<html><head></head><body>\n" + "<script>\n" |