public class CompilerEnvirons
extends java.lang.Object
Constructor and Description |
---|
CompilerEnvirons() |
Modifier and Type | Method and Description |
---|---|
java.util.Set<java.lang.String> |
getActivationNames() |
boolean |
getAllowSharpComments() |
ErrorReporter |
getErrorReporter() |
int |
getLanguageVersion() |
int |
getOptimizationLevel() |
boolean |
getWarnTrailingComma() |
static CompilerEnvirons |
ideEnvirons()
Returns a
CompilerEnvirons suitable for using Rhino
in an IDE environment. |
void |
initFromContext(Context cx) |
boolean |
isAllowMemberExprAsFunctionName()
Extension to ECMA: if 'function <name>' is not followed
by '(', assume <name> starts a
memberExpr |
boolean |
isGenerateDebugInfo() |
boolean |
isGenerateObserverCount() |
boolean |
isGeneratingSource() |
boolean |
isIdeMode() |
boolean |
isRecordingComments() |
boolean |
isRecordingLocalJsDocComments() |
boolean |
isReservedKeywordAsIdentifier() |
boolean |
isStrictMode() |
boolean |
isXmlAvailable() |
boolean |
recoverFromErrors() |
boolean |
reportWarningAsError() |
void |
setActivationNames(java.util.Set<java.lang.String> activationNames) |
void |
setAllowMemberExprAsFunctionName(boolean flag) |
void |
setAllowSharpComments(boolean allow)
Mozilla sources use the C preprocessor.
|
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 |
setIdeMode(boolean ide)
Puts the parser in "IDE" mode.
|
void |
setLanguageVersion(int languageVersion) |
void |
setOptimizationLevel(int level) |
void |
setRecordingComments(boolean record) |
void |
setRecordingLocalJsDocComments(boolean record) |
void |
setRecoverFromErrors(boolean recover)
Turn on or off full error recovery.
|
void |
setReservedKeywordAsIdentifier(boolean flag) |
void |
setStrictMode(boolean strict) |
void |
setWarnTrailingComma(boolean warn) |
void |
setXmlAvailable(boolean flag) |
public void initFromContext(Context cx)
public final ErrorReporter getErrorReporter()
public void setErrorReporter(ErrorReporter errorReporter)
public final int getLanguageVersion()
public void setLanguageVersion(int languageVersion)
public final boolean isGenerateDebugInfo()
public void setGenerateDebugInfo(boolean flag)
public final boolean isReservedKeywordAsIdentifier()
public void setReservedKeywordAsIdentifier(boolean flag)
public final boolean isAllowMemberExprAsFunctionName()
memberExpr
public void setAllowMemberExprAsFunctionName(boolean flag)
public final boolean isXmlAvailable()
public void setXmlAvailable(boolean flag)
public final int getOptimizationLevel()
public void setOptimizationLevel(int level)
public final boolean isGeneratingSource()
public boolean getWarnTrailingComma()
public void setWarnTrailingComma(boolean warn)
public final boolean isStrictMode()
public void setStrictMode(boolean strict)
public final boolean reportWarningAsError()
public void setGeneratingSource(boolean generatingSource)
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.
public boolean isGenerateObserverCount()
public void setGenerateObserverCount(boolean generateObserverCount)
generateObserverCount
- if true, generated code will contain
calls to accumulate an estimate of the instructions executed.public boolean isRecordingComments()
public void setRecordingComments(boolean record)
public boolean isRecordingLocalJsDocComments()
public void setRecordingLocalJsDocComments(boolean record)
public void setRecoverFromErrors(boolean recover)
public boolean recoverFromErrors()
public void setIdeMode(boolean ide)
public boolean isIdeMode()
public java.util.Set<java.lang.String> getActivationNames()
public void setActivationNames(java.util.Set<java.lang.String> activationNames)
public void setAllowSharpComments(boolean allow)
public boolean getAllowSharpComments()
public static CompilerEnvirons ideEnvirons()
CompilerEnvirons
suitable for using Rhino
in an IDE environment. Most features are enabled by default.
The ErrorReporter
is set to an ErrorCollector
.Copyright © 2010 - 2020 Adobe. All Rights Reserved