## com.gargoylesoftware.htmlunit
Class ScriptResult

    java.lang.Object
      com.gargoylesoftware.htmlunit.ScriptResult

    public final class ScriptResult

extends java.lang.Object

This object contains the result of executing a chunk of script code.

Version:
  $Revision: 4402 $
Author:
  Mike Bowler, Marc Guillemot

Constructor Summary
`ScriptResult(java.lang.Object javaScriptResult, Page newPage)` Creates a new instance.

Method Summary
`static ScriptResult` `combine(ScriptResult newResult, ScriptResult originalResult, boolean ie)` Creates and returns a composite `ScriptResult` based on the two input `ScriptResult`s.
`java.lang.Object` `getJavaScriptResult()` Returns the object that was the output of the script engine.
`Page` `getNewPage()` Returns the page that is loaded at the end of the script execution.
`static boolean` `isFalse(ScriptResult scriptResult)` Utility method testing if a script result is `false`.
`static boolean` `isUndefined(ScriptResult scriptResult)` Utility method testing if a script result is undefined (there was no return value).
`java.lang.String` `toString()`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### ScriptResult

    public ScriptResult(java.lang.Object javaScriptResult,
                        Page newPage)

  Creates a new instance.

  Parameters:
    `javaScriptResult` - the object that was returned from the script engine
    `newPage` - the page that is currently loaded at the end of the script execution

Method Detail

### getJavaScriptResult

    public java.lang.Object getJavaScriptResult()

  Returns the object that was the output of the script engine.

  Returns:
    the result from the script engine

### getNewPage

    public Page getNewPage()

  Returns the page that is loaded at the end of the script execution.

  Returns:
    the new page

### toString

    public java.lang.String toString()

  Overrides:
    `toString` in class `java.lang.Object`

### isFalse

    public static boolean isFalse(ScriptResult scriptResult)

  Utility method testing if a script result is `false`.

  Parameters:
    `scriptResult` - a script result (may be `null`)
  Returns:
    `true` if `scriptResult` is `false`

### isUndefined

    public static boolean isUndefined(ScriptResult scriptResult)

  Utility method testing if a script result is undefined (there was no return value).

  Parameters:
    `scriptResult` - a script result (may be `null`)
  Returns:
    `true` if `scriptResult` is undefined (there was no return value)

### combine

    public static ScriptResult combine(ScriptResult newResult,
                                       ScriptResult originalResult,
                                       boolean ie)

  Creates and returns a composite `ScriptResult` based on the two input `ScriptResult`s. This method defines how the return values for multiple event handlers are combined during event capturing and bubbling. The behavior of this method varies based on whether or not we are emulating IE.

  Parameters:
    `newResult` - the new `ScriptResult` (may be `null`)
    `originalResult` - the original `ScriptResult` (may be `null`)
    `ie` - whether or not we are emulating IE
  Returns:
    a composite `ScriptResult`, based on the two input `ScriptResult`s

Copyright © 2002-2011 Gargoyle Software Inc.. All Rights Reserved.