From: <asa...@us...> - 2015-10-02 15:14:17
|
Revision: 11344 http://sourceforge.net/p/htmlunit/code/11344 Author: asashour Date: 2015-10-02 15:14:14 +0000 (Fri, 02 Oct 2015) Log Message: ----------- Committed by mistake Modified Paths: -------------- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java =================================================================== --- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java 2015-10-02 14:54:46 UTC (rev 11343) +++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/javascript/host/Window.java 2015-10-02 15:14:14 UTC (rev 11344) @@ -2073,6 +2073,20 @@ } /** + * {@inheritDoc} + * Used to allow re-declaration of constants (eg: "var undefined;"). + * @see com.gargoylesoftware.htmlunit.javascript.NativeGlobalTest + */ + @Override + public boolean isConst(final String name) { + if ("undefined".equals(name) || "Infinity".equals(name) || "NaN".equals(name)) { + return false; + } + + return super.isConst(name); + } + + /** * Dispatches an event into the event system (standards-conformant browsers only). See * <a href="https://developer.mozilla.org/en-US/docs/DOM/window.dispatchEvent">the Gecko * DOM reference</a> for more information. @@ -2291,14 +2305,6 @@ } return crypto_; } - - /** - * {@inheritDoc} - */ - @Override - public Window getWindow() throws RuntimeException { - return this; - } } class HTMLCollectionFrames extends HTMLCollection { |