org.mozilla.javascript

Class CompilerEnvirons


public class CompilerEnvirons
extends java.lang.Object

Constructor Summary

CompilerEnvirons()

Method Summary

ErrorReporter
getErrorReporter()
int
getLanguageVersion()
int
getOptimizationLevel()
void
initFromContext(Context cx)
boolean
isAllowMemberExprAsFunctionName()
boolean
isGenerateDebugInfo()
boolean
isGenerateObserverCount()
boolean
isGeneratingSource()
boolean
isReservedKeywordAsIdentifier()
boolean
isStrictMode()
boolean
isUseDynamicScope()
boolean
isXmlAvailable()
boolean
reportWarningAsError()
void
setAllowMemberExprAsFunctionName(boolean flag)
void
setErrorReporter(ErrorReporter errorReporter)
void
setGenerateDebugInfo(boolean flag)
void
setGenerateObserverCount(boolean generateObserverCount)
Turn on or off generation of code with callbacks to track the count of executed instructions.
void
setGeneratingSource(boolean generatingSource)
Specify whether or not source information should be generated.
void
setLanguageVersion(int languageVersion)
void
setOptimizationLevel(int level)
void
setReservedKeywordAsIdentifier(boolean flag)
void
setXmlAvailable(boolean flag)

Constructor Details

CompilerEnvirons

public CompilerEnvirons()

Method Details

getErrorReporter

public final ErrorReporter getErrorReporter()

getLanguageVersion

public final int getLanguageVersion()

getOptimizationLevel

public final int getOptimizationLevel()

initFromContext

public void initFromContext(Context cx)

isAllowMemberExprAsFunctionName

public final boolean isAllowMemberExprAsFunctionName()

isGenerateDebugInfo

public final boolean isGenerateDebugInfo()

isGenerateObserverCount

public boolean isGenerateObserverCount()
Returns:
true iff code will be generated with callbacks to enable instruction thresholds

isGeneratingSource

public final boolean isGeneratingSource()

isReservedKeywordAsIdentifier

public final boolean isReservedKeywordAsIdentifier()

isStrictMode

public final boolean isStrictMode()

isUseDynamicScope

public final boolean isUseDynamicScope()

isXmlAvailable

public final boolean isXmlAvailable()

reportWarningAsError

public final boolean reportWarningAsError()

setAllowMemberExprAsFunctionName

public void setAllowMemberExprAsFunctionName(boolean flag)

setErrorReporter

public void setErrorReporter(ErrorReporter errorReporter)

setGenerateDebugInfo

public void setGenerateDebugInfo(boolean flag)

setGenerateObserverCount

public void setGenerateObserverCount(boolean generateObserverCount)
Turn on or off generation of code with callbacks to track the count of executed instructions. Currently only affects JVM byte code generation: this slows down the generated code, but code generated without the callbacks will not be counted toward instruction thresholds. Rhino's interpretive mode does instruction counting without inserting callbacks, so there is no requirement to compile code differently.
Parameters:
generateObserverCount - if true, generated code will contain calls to accumulate an estimate of the instructions executed.

setGeneratingSource

public void setGeneratingSource(boolean generatingSource)
Specify whether or not source information should be generated.

Without source information, evaluating the "toString" method on JavaScript functions produces only "[native code]" for the body of the function. Note that code generated without source is not fully ECMA conformant.


setLanguageVersion

public void setLanguageVersion(int languageVersion)

setOptimizationLevel

public void setOptimizationLevel(int level)

setReservedKeywordAsIdentifier

public void setReservedKeywordAsIdentifier(boolean flag)

setXmlAvailable

public void setXmlAvailable(boolean flag)