diff --git a/deprecatedsrc/org/mozilla/javascript/xml/impl/xmlbeans/XML.java b/deprecatedsrc/org/mozilla/javascript/xml/impl/xmlbeans/XML.java
index c8818a56d7..90b6140389 100644
--- a/deprecatedsrc/org/mozilla/javascript/xml/impl/xmlbeans/XML.java
+++ b/deprecatedsrc/org/mozilla/javascript/xml/impl/xmlbeans/XML.java
@@ -59,7 +59,7 @@ class XML extends XMLObjectImpl
final static class XScriptAnnotation extends XmlBookmark implements Serializable
{
private static final long serialVersionUID = 1L;
-
+
javax.xml.namespace.QName _name;
XML _xScriptXML;
@@ -721,7 +721,7 @@ private XmlCursor copy (XmlCursor cursToCopy)
{
cursToCopy.toNextToken();
}
-
+
cursToCopy.copyXml(copyCurs);
if (!cursToCopy.toNextSibling()) // If element skip element.
{
diff --git a/examples/File.java b/examples/File.java
index 3af0b2793e..986d99c15e 100644
--- a/examples/File.java
+++ b/examples/File.java
@@ -73,7 +73,7 @@
public class File extends ScriptableObject {
/**
- *
+ *
*/
private static final long serialVersionUID = 2549960399774237828L;
/**
diff --git a/examples/Matrix.java b/examples/Matrix.java
index d2e2dd8375..c60844e0bf 100644
--- a/examples/Matrix.java
+++ b/examples/Matrix.java
@@ -54,7 +54,7 @@
* js> defineClass("Matrix")
* js> var m = new Matrix(2); // A constructor call, see "Matrix(int dimension)"
* js> m // Object.toString will call "Matrix.getClassName()"
- * [object Matrix]
+ * [object Matrix]
* js> m[0][0] = 3;
* 3
* js> uneval(m[0]); // an array was created automatically!
diff --git a/src/org/mozilla/javascript/Arguments.java b/src/org/mozilla/javascript/Arguments.java
index 5e3d008e9b..fa60372db6 100644
--- a/src/org/mozilla/javascript/Arguments.java
+++ b/src/org/mozilla/javascript/Arguments.java
@@ -94,7 +94,7 @@ private Object arg(int index) {
}
// the following helper methods assume that 0 < index < args.length
-
+
private void putIntoActivation(int index, Object value) {
String argName = activation.function.getParamOrVarName(index);
activation.put(argName, activation, value);
@@ -108,7 +108,7 @@ private Object getFromActivation(int index) {
private void replaceArg(int index, Object value) {
if (sharedWithActivation(index)) {
putIntoActivation(index, value);
- }
+ }
synchronized (this) {
if (args == activation.originalArgs) {
args = args.clone();
@@ -180,7 +180,7 @@ public void put(int index, Scriptable start, Object value)
if (arg(index) == NOT_FOUND) {
super.put(index, start, value);
} else {
- replaceArg(index, value);
+ replaceArg(index, value);
}
}
@@ -189,7 +189,7 @@ public void delete(int index)
{
if (0 <= index && index < args.length) {
removeArg(index);
- }
+ }
super.delete(index);
}
@@ -315,7 +315,7 @@ Object[] getIds(boolean getAll)
}
if (!getAll) { // avoid adding args which were redefined to non-enumerable
for (int i = 0; i < present.length; i++) {
- if (!present[i] && super.has(i, this)) {
+ if (!present[i] && super.has(i, this)) {
present[i] = true;
extraCount--;
}
@@ -348,7 +348,7 @@ protected ScriptableObject getOwnPropertyDescriptor(Context cx, Object id) {
Object value = arg(index);
if (value == NOT_FOUND) {
return super.getOwnPropertyDescriptor(cx, id);
- }
+ }
if (sharedWithActivation(index)) {
value = getFromActivation(index);
}
@@ -401,7 +401,7 @@ public void defineOwnProperty(Context cx, Object id, ScriptableObject desc) {
private NativeCall activation;
- private BaseFunction objectCtor;
+ private BaseFunction objectCtor;
// Initially args holds activation.getOriginalArgs(), but any modification
// of its elements triggers creation of a copy. If its element holds NOT_FOUND,
diff --git a/src/org/mozilla/javascript/BaseFunction.java b/src/org/mozilla/javascript/BaseFunction.java
index e642763b21..cd87a8cb4b 100644
--- a/src/org/mozilla/javascript/BaseFunction.java
+++ b/src/org/mozilla/javascript/BaseFunction.java
@@ -56,7 +56,7 @@ public class BaseFunction extends IdScriptableObject implements Function
static void init(Scriptable scope, boolean sealed)
{
BaseFunction obj = new BaseFunction();
- // Function.prototype attributes: see ECMA 15.3.3.1
+ // Function.prototype attributes: see ECMA 15.3.3.1
obj.prototypePropertyAttributes = DONTENUM | READONLY | PERMANENT;
obj.exportAsJSClass(MAX_PROTOTYPE_ID, scope, sealed);
}
@@ -74,9 +74,9 @@ public BaseFunction(Scriptable scope, Scriptable prototype)
public String getClassName() {
return "Function";
}
-
+
/**
- * Gets the value returned by calling the typeof operator on this object.
+ * Gets the value returned by calling the typeof operator on this object.
* @see org.mozilla.javascript.ScriptableObject#getTypeOf()
* @return "function" or "undefined" if {@link #avoidObjectDetection()} returns true
*/
@@ -250,7 +250,7 @@ protected void initPrototypeId(int id)
static boolean isApply(IdFunctionObject f) {
return f.hasTag(FUNCTION_TAG) && f.methodId() == Id_apply;
}
-
+
static boolean isApplyOrCall(IdFunctionObject f) {
if(f.hasTag(FUNCTION_TAG)) {
switch(f.methodId()) {
@@ -550,7 +550,7 @@ private static Object jsConstructor(Context cx, Scriptable scope,
Evaluator evaluator = Context.createInterpreter();
if (evaluator == null) {
throw new JavaScriptException("Interpreter not present",
- filename, linep[0]);
+ filename, linep[0]);
}
// Compile with explicit interpreter instance to force interpreter
@@ -599,7 +599,7 @@ protected int findPrototypeId(String s)
private Object prototypeProperty;
// For function object instances, attributes are
- // {configurable:false, enumerable:false};
+ // {configurable:false, enumerable:false};
// see ECMA 15.3.5.2
private int prototypePropertyAttributes = PERMANENT|DONTENUM;
}
diff --git a/src/org/mozilla/javascript/ClassCache.java b/src/org/mozilla/javascript/ClassCache.java
index 1ef86b4aec..1260dd3c93 100644
--- a/src/org/mozilla/javascript/ClassCache.java
+++ b/src/org/mozilla/javascript/ClassCache.java
@@ -60,7 +60,7 @@ public class ClassCache implements Serializable
private transient HashMap> classAdapterCache;
private transient HashMap,Object> interfaceAdapterCache;
private int generatedClassSerial;
- private Scriptable associatedScope;
+ private Scriptable associatedScope;
/**
* Search for ClassCache object in the given scope.
@@ -155,7 +155,7 @@ public synchronized void setCachingEnabled(boolean enabled)
clearCaches();
cachingIsEnabled = enabled;
}
-
+
/**
* @return a map from classes to associated JavaMembers objects
*/
@@ -165,7 +165,7 @@ Map,JavaMembers> getClassCacheMap() {
}
return classTable;
}
-
+
Map> getInterfaceAdapterCacheMap()
{
if (classAdapterCache == null) {
@@ -173,7 +173,7 @@ Map> getInterfaceAdapterCacheMap()
}
return classAdapterCache;
}
-
+
/**
* @deprecated
* The method always returns false.
@@ -208,8 +208,8 @@ public final synchronized int newClassSerialNumber()
Object getInterfaceAdapter(Class> cl)
{
- return interfaceAdapterCache == null
- ? null
+ return interfaceAdapterCache == null
+ ? null
: interfaceAdapterCache.get(cl);
}
@@ -222,7 +222,7 @@ synchronized void cacheInterfaceAdapter(Class> cl, Object iadapter)
interfaceAdapterCache.put(cl, iadapter);
}
}
-
+
Scriptable getAssociatedScope() {
return associatedScope;
}
diff --git a/src/org/mozilla/javascript/CompilerEnvirons.java b/src/org/mozilla/javascript/CompilerEnvirons.java
index d9be273fe4..a558e0a065 100644
--- a/src/org/mozilla/javascript/CompilerEnvirons.java
+++ b/src/org/mozilla/javascript/CompilerEnvirons.java
@@ -84,7 +84,7 @@ public void initFromContext(Context cx)
generatingSource = cx.isGeneratingSource();
activationNames = cx.activationNames;
-
+
// Observer code generation in compiled code :
generateObserverCount = cx.generateObserverCount;
}
diff --git a/src/org/mozilla/javascript/Context.java b/src/org/mozilla/javascript/Context.java
index 28dcee82f2..ab5faf657c 100644
--- a/src/org/mozilla/javascript/Context.java
+++ b/src/org/mozilla/javascript/Context.java
@@ -324,14 +324,14 @@ public class Context
public static final Object[] emptyArgs = ScriptRuntime.emptyArgs;
/**
- * Creates a new Context. The context will be associated with the {@link
+ * Creates a new Context. The context will be associated with the {@link
* ContextFactory#getGlobal() global context factory}.
*
* Note that the Context must be associated with a thread before
* it can be used to execute a script.
- * @deprecated this constructor is deprecated because it creates a
- * dependency on a static singleton context factory. Use
- * {@link ContextFactory#enter()} or
+ * @deprecated this constructor is deprecated because it creates a
+ * dependency on a static singleton context factory. Use
+ * {@link ContextFactory#enter()} or
* {@link ContextFactory#call(ContextAction)} instead. If you subclass
* this class, consider using {@link #Context(ContextFactory)} constructor
* instead in the subclasses' constructors.
@@ -340,13 +340,13 @@ public Context()
{
this(ContextFactory.getGlobal());
}
-
+
/**
* Creates a new context. Provided as a preferred super constructor for
* subclasses in place of the deprecated default public constructor.
* @param factory the context factory associated with this context (most
* likely, the one that created the context). Can not be null. The context
- * features are inherited from the factory, and the context will also
+ * features are inherited from the factory, and the context will also
* otherwise use its factory's services.
* @throws IllegalArgumentException if factory parameter is null.
*/
@@ -1144,11 +1144,11 @@ public final Object evaluateReader(Scriptable scope, Reader in,
return null;
}
}
-
+
/**
* Execute script that may pause execution by capturing a continuation.
* Caller must be prepared to catch a ContinuationPending exception
- * and resume execution by calling
+ * and resume execution by calling
* {@link #resumeContinuation(Object, Scriptable, Object)}.
* @param script The script to execute. Script must have been compiled
* with interpreted mode (optimization level -1)
@@ -1171,11 +1171,11 @@ public Object executeScriptWithContinuations(Script script,
return callFunctionWithContinuations((InterpretedFunction) script,
scope, ScriptRuntime.emptyArgs);
}
-
+
/**
* Call function that may pause execution by capturing a continuation.
* Caller must be prepared to catch a ContinuationPending exception
- * and resume execution by calling
+ * and resume execution by calling
* {@link #resumeContinuation(Object, Scriptable, Object)}.
* @param function The function to call. The function must have been
* compiled with interpreted mode (optimization level -1)
@@ -1203,10 +1203,10 @@ public Object callFunctionWithContinuations(Callable function,
isContinuationsTopCall = true;
return ScriptRuntime.doTopCall(function, this, scope, scope, args);
}
-
+
/**
* Capture a continuation from the current execution. The execution must
- * have been started via a call to
+ * have been started via a call to
* {@link #executeScriptWithContinuations(Script, Scriptable)} or
* {@link #callFunctionWithContinuations(Callable, Scriptable, Object[])}.
* This implies that the code calling
@@ -1221,7 +1221,7 @@ public ContinuationPending captureContinuation() {
return new ContinuationPending(
Interpreter.captureContinuation(this));
}
-
+
/**
* Restarts execution of the JavaScript suspended at the call
* to {@link #captureContinuation()}. Execution of the code will resume
@@ -1230,7 +1230,7 @@ public ContinuationPending captureContinuation() {
* Execution of the script will either conclude normally and the
* result returned, another continuation will be captured and
* thrown, or the script will terminate abnormally and throw an exception.
- * @param continuation The value returned by
+ * @param continuation The value returned by
* {@link ContinuationPending#getContinuation()}
* @param functionResult This value will appear to the code being resumed
* as the result of the function that captured the continuation
@@ -1336,7 +1336,7 @@ public final Script compileReader(Reader in, String sourceName,
*
* @param source the source string
* @param sourceName a string describing the source, such as a filename
- * @param lineno the starting line number for reporting errors. Use
+ * @param lineno the starting line number for reporting errors. Use
* 0 if the line number is unknown.
* @param securityDomain an arbitrary object that specifies security
* information about the origin or owner of the script. For
@@ -1984,17 +1984,17 @@ public synchronized final void setClassShutter(ClassShutter shutter)
classShutter = shutter;
hasClassShutter = true;
}
-
+
final synchronized ClassShutter getClassShutter()
{
return classShutter;
}
-
+
public interface ClassShutterSetter {
public void setClassShutter(ClassShutter shutter);
public ClassShutter getClassShutter();
}
-
+
public final synchronized ClassShutterSetter getClassShutterSetter() {
if (hasClassShutter)
return null;
@@ -2197,10 +2197,10 @@ public boolean hasFeature(int featureIndex)
* Returns an object which specifies an E4X implementation to use within
* this Context. Note that the XMLLib.Factory interface should
* be considered experimental.
- *
+ *
* The default implementation uses the implementation provided by this
* Context's {@link ContextFactory}.
- *
+ *
* @return An XMLLib.Factory. Should not return null if
* {@link #FEATURE_E4X} is enabled. See {@link #hasFeature}.
*/
diff --git a/src/org/mozilla/javascript/ContextFactory.java b/src/org/mozilla/javascript/ContextFactory.java
index 00e5273cd5..aa2874f39c 100644
--- a/src/org/mozilla/javascript/ContextFactory.java
+++ b/src/org/mozilla/javascript/ContextFactory.java
@@ -211,12 +211,12 @@ public synchronized static void initGlobal(ContextFactory factory)
hasCustomGlobal = true;
global = factory;
}
-
+
public interface GlobalSetter {
public void setContextFactoryGlobal(ContextFactory factory);
public ContextFactory getContextFactoryGlobal();
}
-
+
public synchronized static GlobalSetter getGlobalSetter() {
if (hasCustomGlobal) {
throw new IllegalStateException();
@@ -232,7 +232,7 @@ public ContextFactory getContextFactoryGlobal() {
}
return new GlobalSetterImpl();
}
-
+
/**
* Create new {@link Context} instance to be associated with the current
* thread.
@@ -334,10 +334,10 @@ private boolean isDom3Present() {
* {@link org.mozilla.javascript.xml.XMLLib.Factory XMLLib.Factory}
* to be used by the Context instances produced by this
* factory. See {@link Context#getE4xImplementationFactory} for details.
- *
+ *
* May return null, in which case E4X functionality is not supported in
* Rhino.
- *
+ *
* The default implementation now prefers the DOM3 E4X implementation.
*/
protected org.mozilla.javascript.xml.XMLLib.Factory
@@ -536,16 +536,16 @@ public final Object call(ContextAction action)
}
/**
- * Get a context associated with the current thread, creating one if need
- * be. The Context stores the execution state of the JavaScript engine, so
- * it is required that the context be entered before execution may begin.
- * Once a thread has entered a Context, then getCurrentContext() may be
+ * Get a context associated with the current thread, creating one if need
+ * be. The Context stores the execution state of the JavaScript engine, so
+ * it is required that the context be entered before execution may begin.
+ * Once a thread has entered a Context, then getCurrentContext() may be
* called to find the context that is associated with the current thread.
*
- * Calling enterContext() will return either the Context
- * currently associated with the thread, or will create a new context and
- * associate it with the current thread. Each call to
- * enterContext() must have a matching call to
+ * Calling enterContext() will return either the Context
+ * currently associated with the thread, or will create a new context and
+ * associate it with the current thread. Each call to
+ * enterContext() must have a matching call to
* {@link Context#exit()}.
*
* Context cx = contextFactory.enterContext();
@@ -556,8 +556,8 @@ public final Object call(ContextAction action)
* Context.exit();
* }
*
- * Instead of using enterContext(), exit() pair consider
- * using {@link #call(ContextAction)} which guarantees proper association
+ * Instead of using enterContext(), exit() pair consider
+ * using {@link #call(ContextAction)} which guarantees proper association
* of Context instances with the current thread.
* With this method the above example becomes:
*
@@ -578,7 +578,7 @@ public Context enterContext()
{
return enterContext(null);
}
-
+
/**
* @deprecated use {@link #enterContext()} instead
* @return a Context associated with the current thread
@@ -597,7 +597,7 @@ public final void exit()
}
/**
- * Get a Context associated with the current thread, using the given
+ * Get a Context associated with the current thread, using the given
* Context if need be.
*
* The same as enterContext() except that cx
diff --git a/src/org/mozilla/javascript/ContinuationPending.java b/src/org/mozilla/javascript/ContinuationPending.java
index deff4f6bcf..18239e4049 100644
--- a/src/org/mozilla/javascript/ContinuationPending.java
+++ b/src/org/mozilla/javascript/ContinuationPending.java
@@ -39,7 +39,7 @@
package org.mozilla.javascript;
/**
- * Exception thrown by
+ * Exception thrown by
* {@link org.mozilla.javascript.Context#executeScriptWithContinuations(Script, Scriptable)}
* and {@link org.mozilla.javascript.Context#callFunctionWithContinuations(Callable, Scriptable, Object[])}
* when execution encounters a continuation captured by
@@ -52,7 +52,7 @@ public class ContinuationPending extends RuntimeException {
private static final long serialVersionUID = 4956008116771118856L;
private NativeContinuation continuationState;
private Object applicationState;
-
+
/**
* Construct a ContinuationPending exception. Internal call only;
* users of the API should get continuations created on their behalf by
@@ -63,24 +63,24 @@ public class ContinuationPending extends RuntimeException {
ContinuationPending(NativeContinuation continuationState) {
this.continuationState = continuationState;
}
-
+
/**
* Get continuation object. The only
- * use for this object is to be passed to
+ * use for this object is to be passed to
* {@link org.mozilla.javascript.Context#resumeContinuation(Object, Scriptable, Object)}.
* @return continuation object
*/
public Object getContinuation() {
return continuationState;
}
-
+
/**
* @return internal continuation state
*/
NativeContinuation getContinuationState() {
return continuationState;
}
-
+
/**
* Store an arbitrary object that applications can use to associate
* their state with the continuation.
diff --git a/src/org/mozilla/javascript/DToA.java b/src/org/mozilla/javascript/DToA.java
index ad2a68a96c..b2feacbc51 100644
--- a/src/org/mozilla/javascript/DToA.java
+++ b/src/org/mozilla/javascript/DToA.java
@@ -793,7 +793,7 @@ else if ((j1 = -k) != 0) {
}
else
if (d < 0.5 - eps) {
- stripTrailingZeroes(buf);
+ stripTrailingZeroes(buf);
// while(*--s == '0') ;
// s++;
return k + 1;
@@ -1151,7 +1151,7 @@ else if (i < 4) {
return k + 1;
}
- private static void
+ private static void
stripTrailingZeroes(StringBuffer buf)
{
// while(*--s == '0') ;
diff --git a/src/org/mozilla/javascript/Decompiler.java b/src/org/mozilla/javascript/Decompiler.java
index ee453a3d52..afb78b5302 100644
--- a/src/org/mozilla/javascript/Decompiler.java
+++ b/src/org/mozilla/javascript/Decompiler.java
@@ -753,11 +753,11 @@ else if (nextToken == Token.NAME) {
case Token.CONST:
result.append("const ");
break;
-
+
case Token.YIELD:
result.append("yield ");
break;
-
+
case Token.NOT:
result.append('!');
break;
diff --git a/src/org/mozilla/javascript/DefaultErrorReporter.java b/src/org/mozilla/javascript/DefaultErrorReporter.java
index c7d93d4845..f6a0d5c9b0 100644
--- a/src/org/mozilla/javascript/DefaultErrorReporter.java
+++ b/src/org/mozilla/javascript/DefaultErrorReporter.java
@@ -86,7 +86,7 @@ public void error(String message, String sourceURI, int line,
error = TYPE_ERROR_NAME;
message = message.substring(prefix.length());
}
- throw ScriptRuntime.constructError(error, message, sourceURI,
+ throw ScriptRuntime.constructError(error, message, sourceURI,
line, lineText, lineOffset);
}
if (chainedReporter != null) {
diff --git a/src/org/mozilla/javascript/DefiningClassLoader.java b/src/org/mozilla/javascript/DefiningClassLoader.java
index 9723d9c618..a42c9b04db 100644
--- a/src/org/mozilla/javascript/DefiningClassLoader.java
+++ b/src/org/mozilla/javascript/DefiningClassLoader.java
@@ -59,7 +59,7 @@ public Class> defineClass(String name, byte[] data) {
// Use our own protection domain for the generated classes.
// TODO: we might want to use a separate protection domain for classes
// compiled from scripts, based on where the script was loaded from.
- return super.defineClass(name, data, 0, data.length,
+ return super.defineClass(name, data, 0, data.length,
SecurityUtilities.getProtectionDomain(getClass()));
}
diff --git a/src/org/mozilla/javascript/IRFactory.java b/src/org/mozilla/javascript/IRFactory.java
index c97e37a713..5cb85ed271 100644
--- a/src/org/mozilla/javascript/IRFactory.java
+++ b/src/org/mozilla/javascript/IRFactory.java
@@ -613,7 +613,7 @@ private Node transformIf(IfStatement n) {
decompiler.addToken(Token.RP);
decompiler.addEOL(Token.LC);
Node ifTrue = transform(n.getThenPart());
- Node ifFalse = null;
+ Node ifFalse = null;
if (n.getElsePart() != null) {
decompiler.addToken(Token.RC);
decompiler.addToken(Token.ELSE);
@@ -2231,7 +2231,7 @@ void decompilePropertyGet(PropertyGet node) {
decompiler.addToken(Token.DOT);
decompile(node.getProperty());
}
-
+
// only used for destructuring forms
void decompileElementGet(ElementGet node) {
decompile(node.getTarget());
diff --git a/src/org/mozilla/javascript/IdScriptableObject.java b/src/org/mozilla/javascript/IdScriptableObject.java
index 4a6f2d8fb3..c883366fb6 100644
--- a/src/org/mozilla/javascript/IdScriptableObject.java
+++ b/src/org/mozilla/javascript/IdScriptableObject.java
@@ -778,7 +778,7 @@ private ScriptableObject getBuiltInDescriptor(String name) {
value = getInstanceIdValue(id);
attr = (info >>> 16);
return buildDataDescriptor(scope, value, attr);
- }
+ }
if (prototypeValues != null) {
int id = prototypeValues.findId(name);
if (id != 0) {
diff --git a/src/org/mozilla/javascript/InterpretedFunction.java b/src/org/mozilla/javascript/InterpretedFunction.java
index c26890b1f9..e1e2d6dad3 100644
--- a/src/org/mozilla/javascript/InterpretedFunction.java
+++ b/src/org/mozilla/javascript/InterpretedFunction.java
@@ -147,10 +147,10 @@ public String getFunctionName()
/**
* Calls the function.
- * @param cx the current context
+ * @param cx the current context
* @param scope the scope used for the call
* @param thisObj the value of "this"
- * @param args function arguments. Must not be null. You can use
+ * @param args function arguments. Must not be null. You can use
* {@link ScriptRuntime#emptyArgs} to pass empty arguments.
* @return the result of the function call.
*/
@@ -178,7 +178,7 @@ public Object exec(Context cx, Scriptable scope)
return Interpreter.interpret(
this, cx, scope, scope, ScriptRuntime.emptyArgs);
}
-
+
public boolean isScript() {
return idata.itsFunctionType == 0;
}
diff --git a/src/org/mozilla/javascript/Interpreter.java b/src/org/mozilla/javascript/Interpreter.java
index 594db80895..0dadab25f6 100644
--- a/src/org/mozilla/javascript/Interpreter.java
+++ b/src/org/mozilla/javascript/Interpreter.java
@@ -1677,7 +1677,7 @@ private static Object interpretLoop(Context cx, CallFrame frame,
}
}
- // Bug 447697 -- make best effort to keep __noSuchMethod__ within this
+ // Bug 447697 -- make best effort to keep __noSuchMethod__ within this
// interpreter loop invocation
if (fun instanceof NoSuchMethodShim) {
// get the shim and the actual method
@@ -1698,7 +1698,7 @@ private static Object interpretLoop(Context cx, CallFrame frame,
cx.lastInterpreterFrame = frame;
frame.savedCallOp = op;
frame.savedStackTop = stackTop;
- stack[stackTop] = fun.call(cx, calleeScope, funThisObj,
+ stack[stackTop] = fun.call(cx, calleeScope, funThisObj,
getArgsArray(stack, sDbl, stackTop + 2, indexReg));
continue Loop;
@@ -2406,7 +2406,7 @@ private static CallFrame initFrameForNoSuchMethod(Context cx,
argsArray = new Object[2];
argsArray[0] = noSuchMethodShim.methodName;
argsArray[1] = cx.newArray(calleeScope, elements);
-
+
// exactly the same as if it's a regular InterpretedFunction
CallFrame callParentFrame = frame;
CallFrame calleeFrame = new CallFrame();
@@ -2414,7 +2414,7 @@ private static CallFrame initFrameForNoSuchMethod(Context cx,
callParentFrame = frame.parentFrame;
exitFrame(cx, frame, null);
}
- // init the frame with the underlying method with the
+ // init the frame with the underlying method with the
// adjusted args array and shim's function
initFrame(cx, calleeScope, funThisObj, argsArray, null,
0, 2, ifun, callParentFrame, calleeFrame);
@@ -2424,7 +2424,7 @@ private static CallFrame initFrameForNoSuchMethod(Context cx,
}
return calleeFrame;
}
-
+
private static boolean shallowEquals(Object[] stack, double[] sDbl,
int stackTop)
{
@@ -2913,7 +2913,7 @@ private static void setCallResult(CallFrame frame,
}
frame.savedCallOp = 0;
}
-
+
public static NativeContinuation captureContinuation(Context cx) {
if (cx.lastInterpreterFrame == null ||
!(cx.lastInterpreterFrame instanceof CallFrame))
@@ -2953,11 +2953,11 @@ private static NativeContinuation captureContinuation(Context cx, CallFrame fram
outermost = x;
x = x.parentFrame;
}
-
+
if (requireContinuationsTopFrame) {
while (outermost.parentFrame != null)
outermost = outermost.parentFrame;
-
+
if (!outermost.isContinuationsTopFrame) {
throw new IllegalStateException("Cannot capture continuation " +
"from JavaScript code not called directly by " +
@@ -2965,7 +2965,7 @@ private static NativeContinuation captureContinuation(Context cx, CallFrame fram
"callFunctionWithContinuations");
}
}
-
+
c.initImplementation(frame);
return c;
}
diff --git a/src/org/mozilla/javascript/JavaAdapter.java b/src/org/mozilla/javascript/JavaAdapter.java
index cd10f63547..f1a335a629 100644
--- a/src/org/mozilla/javascript/JavaAdapter.java
+++ b/src/org/mozilla/javascript/JavaAdapter.java
@@ -475,13 +475,13 @@ static Method[] getOverridableMethods(Class> clazz)
}
return list.toArray(new Method[list.size()]);
}
-
- private static void appendOverridableMethods(Class> c,
+
+ private static void appendOverridableMethods(Class> c,
ArrayList list, HashSet skip)
{
Method[] methods = c.getDeclaredMethods();
for (int i = 0; i < methods.length; i++) {
- String methodKey = methods[i].getName() +
+ String methodKey = methods[i].getName() +
getMethodSignature(methods[i],
methods[i].getParameterTypes());
if (skip.contains(methodKey))
@@ -522,7 +522,7 @@ static Class> loadAdapterClass(String className, byte[] classBytes)
else {
staticDomain = null;
}
- GeneratedClassLoader loader = SecurityController.createLoader(null,
+ GeneratedClassLoader loader = SecurityController.createLoader(null,
staticDomain);
Class> result = loader.defineClass(className, classBytes);
loader.linkClass(result);
diff --git a/src/org/mozilla/javascript/JavaMembers.java b/src/org/mozilla/javascript/JavaMembers.java
index 5379902dc4..90ae129225 100644
--- a/src/org/mozilla/javascript/JavaMembers.java
+++ b/src/org/mozilla/javascript/JavaMembers.java
@@ -322,12 +322,12 @@ private Object getExplicitFunction(Scriptable scope, String name,
/**
* Retrieves mapping of methods to accessible methods for a class.
- * In case the class is not public, retrieves methods with same
- * signature as its public methods from public superclasses and
- * interfaces (if they exist). Basically upcasts every method to the
+ * In case the class is not public, retrieves methods with same
+ * signature as its public methods from public superclasses and
+ * interfaces (if they exist). Basically upcasts every method to the
* nearest accessible method.
*/
- private static Method[] discoverAccessibleMethods(Class> clazz,
+ private static Method[] discoverAccessibleMethods(Class> clazz,
boolean includeProtected,
boolean includePrivate)
{
@@ -335,8 +335,8 @@ private static Method[] discoverAccessibleMethods(Class> clazz,
discoverAccessibleMethods(clazz, map, includeProtected, includePrivate);
return map.values().toArray(new Method[map.size()]);
}
-
- private static void discoverAccessibleMethods(Class> clazz,
+
+ private static void discoverAccessibleMethods(Class> clazz,
Map map, boolean includeProtected,
boolean includePrivate)
{
@@ -349,7 +349,7 @@ private static void discoverAccessibleMethods(Class> clazz,
for (int i = 0; i < methods.length; i++) {
Method method = methods[i];
int mods = method.getModifiers();
-
+
if (Modifier.isPublic(mods) ||
Modifier.isProtected(mods) ||
includePrivate)
@@ -370,7 +370,7 @@ private static void discoverAccessibleMethods(Class> clazz,
Method[] methods = clazz.getMethods();
for (int i = 0; i < methods.length; i++) {
Method method = methods[i];
- MethodSignature sig
+ MethodSignature sig
= new MethodSignature(method);
if (!map.containsKey(sig))
map.put(sig, method);
@@ -416,18 +416,18 @@ private static final class MethodSignature
{
private final String name;
private final Class>[] args;
-
+
private MethodSignature(String name, Class>[] args)
{
this.name = name;
this.args = args;
}
-
+
MethodSignature(Method method)
{
this(method.getName(), method.getParameterTypes());
}
-
+
@Override
public boolean equals(Object o)
{
@@ -438,14 +438,14 @@ public boolean equals(Object o)
}
return false;
}
-
+
@Override
public int hashCode()
{
return name.hashCode() ^ args.length;
}
}
-
+
private void reflect(Scriptable scope, boolean includeProtected)
{
// We reflect methods first, because we want overloaded field/method
@@ -578,7 +578,7 @@ private void reflect(Scriptable scope, boolean includeProtected)
boolean memberIsGetMethod = name.startsWith("get");
boolean memberIsSetMethod = name.startsWith("set");
boolean memberIsIsMethod = name.startsWith("is");
- if (memberIsGetMethod || memberIsIsMethod
+ if (memberIsGetMethod || memberIsIsMethod
|| memberIsSetMethod) {
// Double check name component.
String nameComponent
@@ -636,14 +636,14 @@ private void reflect(Scriptable scope, boolean includeProtected)
if (member instanceof NativeJavaMethod) {
NativeJavaMethod njmSet = (NativeJavaMethod)member;
if (getter != null) {
- // We have a getter. Now, do we have a matching
+ // We have a getter. Now, do we have a matching
// setter?
Class> type = getter.method().getReturnType();
setter = extractSetMethod(type, njmSet.methods,
isStatic);
} else {
// No getter, find any set method
- setter = extractSetMethod(njmSet.methods,
+ setter = extractSetMethod(njmSet.methods,
isStatic);
}
if (njmSet.methods.length > 1) {
diff --git a/src/org/mozilla/javascript/LazilyLoadedCtor.java b/src/org/mozilla/javascript/LazilyLoadedCtor.java
index caf11afa56..a1d72c98ef 100644
--- a/src/org/mozilla/javascript/LazilyLoadedCtor.java
+++ b/src/org/mozilla/javascript/LazilyLoadedCtor.java
@@ -50,7 +50,7 @@
*/
public final class LazilyLoadedCtor implements java.io.Serializable {
private static final long serialVersionUID = 1L;
-
+
private static final int STATE_BEFORE_INIT = 0;
private static final int STATE_INITIALIZING = 1;
private static final int STATE_WITH_VALUE = 2;
@@ -63,7 +63,7 @@ public final class LazilyLoadedCtor implements java.io.Serializable {
private Object initializedValue;
private int state;
- public LazilyLoadedCtor(ScriptableObject scope, String propertyName,
+ public LazilyLoadedCtor(ScriptableObject scope, String propertyName,
String className, boolean sealed)
{
this(scope, propertyName, className, sealed, false);
@@ -129,7 +129,7 @@ public Object run()
return buildValue0();
}
}
-
+
private Object buildValue0()
{
Class extends Scriptable> cl = cast(Kit.classOrNull(className));
@@ -160,7 +160,7 @@ private Object buildValue0()
}
return Scriptable.NOT_FOUND;
}
-
+
@SuppressWarnings({"unchecked"})
private Class extends Scriptable> cast(Class> cl) {
return (Class extends Scriptable>)cl;
diff --git a/src/org/mozilla/javascript/MemberBox.java b/src/org/mozilla/javascript/MemberBox.java
index 8a50fe88b3..34411e1978 100644
--- a/src/org/mozilla/javascript/MemberBox.java
+++ b/src/org/mozilla/javascript/MemberBox.java
@@ -178,9 +178,9 @@ Object invoke(Object target, Object[] args)
do {
e = ((InvocationTargetException) e).getTargetException();
} while ((e instanceof InvocationTargetException));
- if (e instanceof ContinuationPending)
+ if (e instanceof ContinuationPending)
throw (ContinuationPending) e;
- throw Context.throwAsScriptRuntimeEx(e);
+ throw Context.throwAsScriptRuntimeEx(e);
} catch (Exception ex) {
throw Context.throwAsScriptRuntimeEx(ex);
}
diff --git a/src/org/mozilla/javascript/NativeArray.java b/src/org/mozilla/javascript/NativeArray.java
index 2f2f92ff64..99c9567800 100644
--- a/src/org/mozilla/javascript/NativeArray.java
+++ b/src/org/mozilla/javascript/NativeArray.java
@@ -79,7 +79,7 @@ static void init(Scriptable scope, boolean sealed)
NativeArray obj = new NativeArray(0);
obj.exportAsJSClass(MAX_PROTOTYPE_ID, scope, sealed);
}
-
+
static int getMaximumInitialCapacity() {
return maximumInitialCapacity;
}
@@ -157,7 +157,7 @@ protected void setInstanceIdValue(int id, Object value)
}
super.setInstanceIdValue(id, value);
}
-
+
@Override
protected void fillConstructorProperties(IdFunctionObject ctor)
{
@@ -281,7 +281,7 @@ public Object execIdCall(IdFunctionObject f, Context cx, Scriptable scope,
case ConstructorId_isArray:
return args.length > 0 && (args[0] instanceof NativeArray);
-
+
case Id_constructor: {
boolean inNewExpr = (thisObj == null);
if (!inNewExpr) {
@@ -290,53 +290,53 @@ public Object execIdCall(IdFunctionObject f, Context cx, Scriptable scope,
}
return jsConstructor(cx, scope, args);
}
-
+
case Id_toString:
return toStringHelper(cx, scope, thisObj,
cx.hasFeature(Context.FEATURE_TO_STRING_AS_SOURCE), false);
-
+
case Id_toLocaleString:
return toStringHelper(cx, scope, thisObj, false, true);
-
+
case Id_toSource:
return toStringHelper(cx, scope, thisObj, true, false);
-
+
case Id_join:
return js_join(cx, thisObj, args);
-
+
case Id_reverse:
return js_reverse(cx, thisObj, args);
-
+
case Id_sort:
return js_sort(cx, scope, thisObj, args);
-
+
case Id_push:
return js_push(cx, thisObj, args);
-
+
case Id_pop:
return js_pop(cx, thisObj, args);
-
+
case Id_shift:
return js_shift(cx, thisObj, args);
-
+
case Id_unshift:
return js_unshift(cx, thisObj, args);
-
+
case Id_splice:
return js_splice(cx, scope, thisObj, args);
-
+
case Id_concat:
return js_concat(cx, scope, thisObj, args);
-
+
case Id_slice:
return js_slice(cx, thisObj, args);
-
+
case Id_indexOf:
return indexOfHelper(cx, thisObj, args, false);
-
+
case Id_lastIndexOf:
return indexOfHelper(cx, thisObj, args, true);
-
+
case Id_every:
case Id_filter:
case Id_forEach:
@@ -617,7 +617,7 @@ public long getLength() {
public long jsGet_length() {
return getLength();
}
-
+
/**
* Change the value of the internal flag that determines whether all
* storage is handed by a dense backing array rather than an associative
@@ -1531,7 +1531,7 @@ else if (start < 0)
/**
* Implements the methods "every", "filter", "forEach", "map", and "some".
*/
- private Object iterativeMethod(Context cx, int id, Scriptable scope,
+ private Object iterativeMethod(Context cx, int id, Scriptable scope,
Scriptable thisObj, Object[] args)
{
Object callbackArg = args.length > 0 ? args[0] : Undefined.instance;
@@ -1900,7 +1900,7 @@ protected int findPrototypeId(String s)
// #/generated#
return id;
}
-
+
private static final int
Id_constructor = 1,
Id_toString = 2,
@@ -1929,7 +1929,7 @@ protected int findPrototypeId(String s)
MAX_PROTOTYPE_ID = 23;
// #/string_id_map#
-
+
private static final int
ConstructorId_join = -Id_join,
ConstructorId_reverse = -Id_reverse,
diff --git a/src/org/mozilla/javascript/NativeDate.java b/src/org/mozilla/javascript/NativeDate.java
index 43dedd2784..cbdd03aa2a 100644
--- a/src/org/mozilla/javascript/NativeDate.java
+++ b/src/org/mozilla/javascript/NativeDate.java
@@ -26,7 +26,7 @@
* Norris Boyd
* Mike McCabe
* Ilya Frank
- *
+ *
*
* Alternatively, the contents of this file may be used under the terms of
* the GNU General Public License Version 2 or later (the "GPL"), in which
@@ -224,12 +224,12 @@ public Object execIdCall(IdFunctionObject f, Context cx, Scriptable scope,
}
Object toISO = o.get(toISOString, o);
if (toISO == NOT_FOUND) {
- throw ScriptRuntime.typeError2("msg.function.not.found.in",
+ throw ScriptRuntime.typeError2("msg.function.not.found.in",
toISOString,
ScriptRuntime.toString(o));
}
if ( !(toISO instanceof Callable) ) {
- throw ScriptRuntime.typeError3("msg.isnt.function.in",
+ throw ScriptRuntime.typeError3("msg.isnt.function.in",
toISOString,
ScriptRuntime.toString(o),
ScriptRuntime.toString(toISO));
@@ -237,9 +237,9 @@ public Object execIdCall(IdFunctionObject f, Context cx, Scriptable scope,
Object result = ((Callable) toISO).call(cx, scope, o,
ScriptRuntime.emptyArgs);
if ( !ScriptRuntime.isPrimitive(result) ) {
- throw ScriptRuntime.typeError1("msg.toisostring.must.return.primitive",
+ throw ScriptRuntime.typeError1("msg.toisostring.must.return.primitive",
ScriptRuntime.toString(result));
- }
+ }
return result;
}
diff --git a/src/org/mozilla/javascript/NativeError.java b/src/org/mozilla/javascript/NativeError.java
index 44d28b55ee..373d5117dc 100644
--- a/src/org/mozilla/javascript/NativeError.java
+++ b/src/org/mozilla/javascript/NativeError.java
@@ -98,7 +98,7 @@ public String getClassName()
@Override
public String toString()
{
- // According to spec, Error.prototype.toString() may return undefined.
+ // According to spec, Error.prototype.toString() may return undefined.
Object toString = js_toString(this);
return toString instanceof String ? (String) toString : super.toString();
}
@@ -168,7 +168,7 @@ public Object getStack() {
public void setStack(Object value) {
if (stackProvider != null) {
stackProvider = null;
- delete("stack");
+ delete("stack");
}
put("stack", this, value);
}
diff --git a/src/org/mozilla/javascript/NativeFunction.java b/src/org/mozilla/javascript/NativeFunction.java
index ffa6a86bc1..3c335ffed8 100644
--- a/src/org/mozilla/javascript/NativeFunction.java
+++ b/src/org/mozilla/javascript/NativeFunction.java
@@ -163,8 +163,8 @@ public Object resumeGenerator(Context cx, Scriptable scope,
*/
protected boolean getParamOrVarConst(int index)
{
- // By default return false to preserve compatibility with existing
- // classes subclassing this class, which are mostly generated by jsc
+ // By default return false to preserve compatibility with existing
+ // classes subclassing this class, which are mostly generated by jsc
// from earlier Rhino versions. See Bugzilla #396117.
return false;
}
diff --git a/src/org/mozilla/javascript/NativeGlobal.java b/src/org/mozilla/javascript/NativeGlobal.java
index 7f403f38c3..01e85df56d 100644
--- a/src/org/mozilla/javascript/NativeGlobal.java
+++ b/src/org/mozilla/javascript/NativeGlobal.java
@@ -147,7 +147,7 @@ public static void init(Context cx, Scriptable scope, boolean sealed) {
*/
for (int i = 0; i < errorMethods.length; i++) {
String name = errorMethods[i];
- ScriptableObject errorProto =
+ ScriptableObject errorProto =
(ScriptableObject) ScriptRuntime.newObject(cx, scope, "Error",
ScriptRuntime.emptyArgs);
errorProto.put("name", errorProto, name);
diff --git a/src/org/mozilla/javascript/NativeIterator.java b/src/org/mozilla/javascript/NativeIterator.java
index 1e72be7989..0858104c3e 100644
--- a/src/org/mozilla/javascript/NativeIterator.java
+++ b/src/org/mozilla/javascript/NativeIterator.java
@@ -33,7 +33,7 @@
import java.util.Iterator;
/**
- * This class implements iterator objects. See
+ * This class implements iterator objects. See
* http://developer.mozilla.org/en/docs/New_in_JavaScript_1.7#Iterators
*
* @author Norris Boyd
@@ -41,7 +41,7 @@
public final class NativeIterator extends IdScriptableObject {
private static final long serialVersionUID = -4136968203581667681L;
private static final Object ITERATOR_TAG = "Iterator";
-
+
static void init(ScriptableObject scope, boolean sealed) {
// Iterator
NativeIterator iterator = new NativeIterator();
@@ -62,13 +62,13 @@ static void init(ScriptableObject scope, boolean sealed) {
// scope is replaced or deleted.
scope.associateValue(ITERATOR_TAG, obj);
}
-
+
/**
* Only for constructing the prototype object.
*/
private NativeIterator() {
}
-
+
private NativeIterator(Object objectIterator) {
this.objectIterator = objectIterator;
}
@@ -85,10 +85,10 @@ public static Object getStopIterationObject(Scriptable scope) {
Scriptable top = ScriptableObject.getTopLevelScope(scope);
return ScriptableObject.getTopScopeValue(top, ITERATOR_TAG);
}
-
+
private static final String STOP_ITERATION = "StopIteration";
public static final String ITERATOR_PROPERTY_NAME = "__iterator__";
-
+
static class StopIteration extends NativeObject {
private static final long serialVersionUID = 2485151085722377663L;
@@ -132,50 +132,50 @@ public Object execIdCall(IdFunctionObject f, Context cx, Scriptable scope,
return super.execIdCall(f, cx, scope, thisObj, args);
}
int id = f.methodId();
-
+
if (id == Id_constructor) {
return jsConstructor(cx, scope, thisObj, args);
}
if (!(thisObj instanceof NativeIterator))
throw incompatibleCallError(f);
-
+
NativeIterator iterator = (NativeIterator) thisObj;
-
+
switch (id) {
- case Id_next:
+ case Id_next:
return iterator.next(cx, scope);
case Id___iterator__:
/// XXX: what about argument? SpiderMonkey apparently ignores it
return thisObj;
- default:
+ default:
throw new IllegalArgumentException(String.valueOf(id));
}
}
-
+
/* The JavaScript constructor */
- private static Object jsConstructor(Context cx, Scriptable scope,
+ private static Object jsConstructor(Context cx, Scriptable scope,
Scriptable thisObj, Object[] args)
{
- if (args.length == 0 || args[0] == null ||
+ if (args.length == 0 || args[0] == null ||
args[0] == Undefined.instance)
{
Object argument = args.length == 0 ? Undefined.instance : args[0];
- throw ScriptRuntime.typeError1("msg.no.properties",
+ throw ScriptRuntime.typeError1("msg.no.properties",
ScriptRuntime.toString(argument));
}
Scriptable obj = ScriptRuntime.toObject(scope, args[0]);
boolean keyOnly = args.length > 1 && ScriptRuntime.toBoolean(args[1]);
if (thisObj != null) {
// Called as a function. Convert to iterator if possible.
-
+
// For objects that implement java.lang.Iterable or
// java.util.Iterator, have JavaScript Iterator call the underlying
// iteration methods
- Iterator> iterator =
+ Iterator> iterator =
VMBridge.instance.getJavaIterator(cx, scope, obj);
if (iterator != null) {
scope = ScriptableObject.getTopLevelScope(scope);
@@ -183,15 +183,15 @@ private static Object jsConstructor(Context cx, Scriptable scope,
new WrappedJavaIterator(iterator, scope),
WrappedJavaIterator.class);
}
-
+
// Otherwise, just call the runtime routine
- Scriptable jsIterator = ScriptRuntime.toIterator(cx, scope, obj,
+ Scriptable jsIterator = ScriptRuntime.toIterator(cx, scope, obj,
keyOnly);
if (jsIterator != null) {
return jsIterator;
}
}
-
+
// Otherwise, just set up to iterate over the properties of the object.
// Do not call __iterator__ method.
Object objectIterator = ScriptRuntime.enumInit(obj, cx,
@@ -199,12 +199,12 @@ private static Object jsConstructor(Context cx, Scriptable scope,
: ScriptRuntime.ENUMERATE_ARRAY_NO_ITERATOR);
ScriptRuntime.setEnumNumbers(objectIterator, true);
NativeIterator result = new NativeIterator(objectIterator);
- result.setPrototype(ScriptableObject.getClassPrototype(scope,
+ result.setPrototype(ScriptableObject.getClassPrototype(scope,
result.getClassName()));
result.setParentScope(scope);
return result;
}
-
+
private Object next(Context cx, Scriptable scope) {
Boolean b = ScriptRuntime.enumNext(this.objectIterator);
if (!b.booleanValue()) {
@@ -214,7 +214,7 @@ private Object next(Context cx, Scriptable scope) {
}
return ScriptRuntime.enumId(this.objectIterator, cx);
}
-
+
static public class WrappedJavaIterator
{
WrappedJavaIterator(Iterator> iterator, Scriptable scope) {
@@ -238,7 +238,7 @@ public Object __iterator__(boolean b) {
private Iterator> iterator;
private Scriptable scope;
}
-
+
// #string_id_map#
@Override
diff --git a/src/org/mozilla/javascript/NativeJSON.java b/src/org/mozilla/javascript/NativeJSON.java
index 441fefefdf..aa3dec6172 100644
--- a/src/org/mozilla/javascript/NativeJSON.java
+++ b/src/org/mozilla/javascript/NativeJSON.java
@@ -144,7 +144,7 @@ private static Object parse(Context cx, Scriptable scope, String jtext) {
return new JsonParser(cx, scope).parseValue(jtext);
} catch (JsonParser.ParseException ex) {
throw ScriptRuntime.constructError("SyntaxError", ex.getMessage());
- }
+ }
}
public static Object parse(Context cx, Scriptable scope, String jtext,
@@ -179,18 +179,18 @@ private static Object walk(Context cx, Scriptable scope, Callable reviver,
}
}
} else {
- Object[] keys = val.getIds();
+ Object[] keys = val.getIds();
for (Object p : keys) {
Object newElement = walk(cx, scope, reviver, val, p);
if (newElement == Undefined.instance) {
- if (p instanceof Number)
+ if (p instanceof Number)
val.delete(((Number) p).intValue());
- else
+ else
val.delete((String) p);
} else {
- if (p instanceof Number)
+ if (p instanceof Number)
val.put(((Number) p).intValue(), val, newElement);
- else
+ else
val.put((String) p, val, newElement);
}
}
@@ -251,7 +251,7 @@ public static Object stringify(Context cx, Scriptable scope, Object value,
if (v instanceof String || v instanceof Number) {
propertyList.add(v);
} else if (v instanceof NativeString || v instanceof NativeNumber) {
- propertyList.add(ScriptRuntime.toString(v));
+ propertyList.add(ScriptRuntime.toString(v));
}
}
}
@@ -316,7 +316,7 @@ private static Object str(Object key, Scriptable holder,
value = ScriptRuntime.toNumber(value);
} else if (value instanceof NativeString) {
value = ScriptRuntime.toString(value);
- } else if (value instanceof NativeBoolean) {
+ } else if (value instanceof NativeBoolean) {
value = ((NativeBoolean) value).getDefaultValue(ScriptRuntime.BooleanClass);
}
diff --git a/src/org/mozilla/javascript/NativeJavaClass.java b/src/org/mozilla/javascript/NativeJavaClass.java
index c88572c27c..dc3f8f664e 100644
--- a/src/org/mozilla/javascript/NativeJavaClass.java
+++ b/src/org/mozilla/javascript/NativeJavaClass.java
@@ -114,7 +114,7 @@ public Object get(String name, Scriptable start) {
if (members.has(name, true)) {
return members.get(this, name, javaObject, true);
}
-
+
Context cx = Context.getContext();
Scriptable scope = ScriptableObject.getTopLevelScope(start);
WrapFactory wrapFactory = cx.getWrapFactory();
@@ -123,7 +123,7 @@ public Object get(String name, Scriptable start) {
return wrapFactory.wrap(cx, scope, javaObject,
ScriptRuntime.ClassClass);
}
-
+
// experimental: look for nested classes by appending $name to
// current class' name.
Class> nestedClass = findNestedClass(getClassObject(), name);
@@ -133,7 +133,7 @@ public Object get(String name, Scriptable start) {
nestedValue.setParentScope(this);
return nestedValue;
}
-
+
throw members.reportMemberNotFound(name);
}
@@ -230,16 +230,16 @@ static Scriptable constructSpecific(Context cx, Scriptable scope,
{
Scriptable topLevel = ScriptableObject.getTopLevelScope(scope);
Class>[] argTypes = ctor.argTypes;
-
+
if (ctor.vararg) {
// marshall the explicit parameter
Object[] newArgs = new Object[argTypes.length];
for (int i = 0; i < argTypes.length-1; i++) {
newArgs[i] = Context.jsToJava(args[i], argTypes[i]);
}
-
+
Object varArgs;
-
+
// Handle special situation where a single variable parameter
// is given and it is a Java or ECMA array.
if (args.length == argTypes.length &&
@@ -248,21 +248,21 @@ static Scriptable constructSpecific(Context cx, Scriptable scope,
args[args.length-1] instanceof NativeJavaArray))
{
// convert the ECMA array into a native array
- varArgs = Context.jsToJava(args[args.length-1],
+ varArgs = Context.jsToJava(args[args.length-1],
argTypes[argTypes.length - 1]);
- } else {
+ } else {
// marshall the variable parameter
Class> componentType = argTypes[argTypes.length - 1].
getComponentType();
- varArgs = Array.newInstance(componentType,
- args.length - argTypes.length + 1);
+ varArgs = Array.newInstance(componentType,
+ args.length - argTypes.length + 1);
for (int i=0; i < Array.getLength(varArgs); i++) {
Object value = Context.jsToJava(args[argTypes.length-1 + i],
componentType);
Array.set(varArgs, i, value);
}
}
-
+
// add varargs
newArgs[argTypes.length-1] = varArgs;
// replace the original args with the new one
@@ -280,7 +280,7 @@ static Scriptable constructSpecific(Context cx, Scriptable scope,
}
}
}
-
+
Object instance = ctor.newInstance(args);
// we need to force this to be wrapped, because construct _has_
// to return a scriptable
diff --git a/src/org/mozilla/javascript/NativeJavaMethod.java b/src/org/mozilla/javascript/NativeJavaMethod.java
index 5b09d8c9bb..0be9043b10 100644
--- a/src/org/mozilla/javascript/NativeJavaMethod.java
+++ b/src/org/mozilla/javascript/NativeJavaMethod.java
@@ -168,16 +168,16 @@ public Object call(Context cx, Scriptable scope, Scriptable thisObj,
MemberBox meth = methods[index];
Class>[] argTypes = meth.argTypes;
-
+
if (meth.vararg) {
// marshall the explicit parameters
Object[] newArgs = new Object[argTypes.length];
for (int i = 0; i < argTypes.length-1; i++) {
newArgs[i] = Context.jsToJava(args[i], argTypes[i]);
}
-
+
Object varArgs;
-
+
// Handle special situation where a single variable parameter
// is given and it is a Java or ECMA array or is null.
if (args.length == argTypes.length &&
@@ -186,26 +186,26 @@ public Object call(Context cx, Scriptable scope, Scriptable thisObj,
args[args.length-1] instanceof NativeJavaArray))
{
// convert the ECMA array into a native array
- varArgs = Context.jsToJava(args[args.length-1],
+ varArgs = Context.jsToJava(args[args.length-1],
argTypes[argTypes.length - 1]);
- } else {
+ } else {
// marshall the variable parameters
Class> componentType = argTypes[argTypes.length - 1].
getComponentType();
- varArgs = Array.newInstance(componentType,
- args.length - argTypes.length + 1);
+ varArgs = Array.newInstance(componentType,
+ args.length - argTypes.length + 1);
for (int i = 0; i < Array.getLength(varArgs); i++) {
- Object value = Context.jsToJava(args[argTypes.length-1 + i],
+ Object value = Context.jsToJava(args[argTypes.length-1 + i],
componentType);
Array.set(varArgs, i, value);
}
}
-
+
// add varargs
newArgs[argTypes.length-1] = varArgs;
// replace the original args with the new one
args = newArgs;
- } else {
+ } else {
// First, we marshall the args.
Object[] origArgs = args;
for (int i = 0; i < args.length; i++) {
@@ -284,7 +284,7 @@ static int findFunction(Context cx,
MemberBox member = methodsOrCtors[0];
Class>[] argTypes = member.argTypes;
int alength = argTypes.length;
-
+
if (member.vararg) {
alength--;
if ( alength > args.length) {
@@ -478,7 +478,7 @@ static int findFunction(Context cx,
* Returns one of PREFERENCE_EQUAL, PREFERENCE_FIRST_ARG,
* PREFERENCE_SECOND_ARG, or PREFERENCE_AMBIGUOUS.
*/
- private static int preferSignature(Object[] args,
+ private static int preferSignature(Object[] args,
Class>[] sig1,
boolean vararg1,
Class>[] sig2,
diff --git a/src/org/mozilla/javascript/NativeJavaObject.java b/src/org/mozilla/javascript/NativeJavaObject.java
index b32af95ca3..acdfbc39da 100644
--- a/src/org/mozilla/javascript/NativeJavaObject.java
+++ b/src/org/mozilla/javascript/NativeJavaObject.java
@@ -87,7 +87,7 @@ protected void initMembers() {
} else {
dynamicType = staticType;
}
- members = JavaMembers.lookupClass(parent, dynamicType, staticType,
+ members = JavaMembers.lookupClass(parent, dynamicType, staticType,
isAdapter);
fieldAndMethods
= members.getFieldAndMethodsObjects(this, javaObject, false);
@@ -603,7 +603,7 @@ else if (type == ScriptRuntime.StringClass) {
break;
case JSTYPE_JAVA_OBJECT:
- case JSTYPE_JAVA_ARRAY:
+ case JSTYPE_JAVA_ARRAY:
if (value instanceof Wrapper) {
value = ((Wrapper)value).unwrap();
}
@@ -613,7 +613,7 @@ else if (type == ScriptRuntime.StringClass) {
}
return coerceToNumber(type, value);
}
- else {
+ else {
if (type == ScriptRuntime.StringClass) {
return value.toString();
}
@@ -838,7 +838,7 @@ else if (value instanceof Scriptable) {
else {
Method meth;
try {
- meth = value.getClass().getMethod("doubleValue",
+ meth = value.getClass().getMethod("doubleValue",
(Class [])null);
}
catch (NoSuchMethodException e) {
@@ -849,7 +849,7 @@ else if (value instanceof Scriptable) {
}
if (meth != null) {
try {
- return ((Number)meth.invoke(value,
+ return ((Number)meth.invoke(value,
(Object [])null)).doubleValue();
}
catch (IllegalAccessException e) {
diff --git a/src/org/mozilla/javascript/NativeNumber.java b/src/org/mozilla/javascript/NativeNumber.java
index 3f0b8e7dc1..a5f8e02aba 100644
--- a/src/org/mozilla/javascript/NativeNumber.java
+++ b/src/org/mozilla/javascript/NativeNumber.java
@@ -161,7 +161,7 @@ public Object execIdCall(IdFunctionObject f, Context cx, Scriptable scope,
return num_to(value, args, DToA.DTOSTR_FIXED,
DToA.DTOSTR_FIXED, -20, 0);
- case Id_toExponential: {
+ case Id_toExponential: {
// Handle special values before range check
if(Double.isNaN(value)) {
return "NaN";
diff --git a/src/org/mozilla/javascript/NativeObject.java b/src/org/mozilla/javascript/NativeObject.java
index 76e79be8bb..49566f5b72 100644
--- a/src/org/mozilla/javascript/NativeObject.java
+++ b/src/org/mozilla/javascript/NativeObject.java
@@ -269,7 +269,7 @@ public Object execIdCall(IdFunctionObject f, Context cx, Scriptable scope,
if (args.length < 1 ||
!(thisObj instanceof ScriptableObject))
return Undefined.instance;
-
+
ScriptableObject so = (ScriptableObject)thisObj;
String name = ScriptRuntime.toStringIdOrIndex(cx, args[0]);
int index = (name != null ? 0
@@ -391,7 +391,7 @@ public Object execIdCall(IdFunctionObject f, Context cx, Scriptable scope,
for (Object name: obj.getAllIds()) {
Object configurable = obj.getOwnPropertyDescriptor(cx, name).get("configurable");
- if (Boolean.TRUE.equals(configurable))
+ if (Boolean.TRUE.equals(configurable))
return false;
}
@@ -406,7 +406,7 @@ public Object execIdCall(IdFunctionObject f, Context cx, Scriptable scope,
for (Object name: obj.getAllIds()) {
ScriptableObject desc = obj.getOwnPropertyDescriptor(cx, name);
- if (Boolean.TRUE.equals(desc.get("configurable")))
+ if (Boolean.TRUE.equals(desc.get("configurable")))
return false;
if (isDataDescriptor(desc) && Boolean.TRUE.equals(desc.get("writable")))
return false;
@@ -423,7 +423,7 @@ public Object execIdCall(IdFunctionObject f, Context cx, Scriptable scope,
ScriptableObject desc = obj.getOwnPropertyDescriptor(cx, name);
if (Boolean.TRUE.equals(desc.get("configurable"))) {
desc.put("configurable", desc, false);
- obj.defineOwnProperty(cx, name, desc);
+ obj.defineOwnProperty(cx, name, desc);
}
}
obj.preventExtensions();
diff --git a/src/org/mozilla/javascript/NativeString.java b/src/org/mozilla/javascript/NativeString.java
index ad03f4055e..0eeccd04e8 100644
--- a/src/org/mozilla/javascript/NativeString.java
+++ b/src/org/mozilla/javascript/NativeString.java
@@ -243,7 +243,7 @@ public Object execIdCall(IdFunctionObject f, Context cx, Scriptable scope,
id = -id;
continue again;
}
-
+
case ConstructorId_fromCharCode: {
int N = args.length;
if (N < 1)
@@ -254,7 +254,7 @@ public Object execIdCall(IdFunctionObject f, Context cx, Scriptable scope,
}
return sb.toString();
}
-
+
case Id_constructor: {
String s = (args.length >= 1)
? ScriptRuntime.toString(args[0]) : "";
@@ -265,17 +265,17 @@ public Object execIdCall(IdFunctionObject f, Context cx, Scriptable scope,
// String(val) converts val to a string value.
return s;
}
-
+
case Id_toString:
case Id_valueOf:
// ECMA 15.5.4.2: 'the toString function is not generic.
return realThis(thisObj, f).string;
-
+
case Id_toSource: {
String s = realThis(thisObj, f).string;
return "(new String(\""+ScriptRuntime.escapeString(s)+"\"))";
}
-
+
case Id_charAt:
case Id_charCodeAt: {
// See ECMA 15.5.4.[4,5]
@@ -289,90 +289,90 @@ public Object execIdCall(IdFunctionObject f, Context cx, Scriptable scope,
if (id == Id_charAt) return String.valueOf(c);
else return ScriptRuntime.wrapInt(c);
}
-
+
case Id_indexOf:
return ScriptRuntime.wrapInt(js_indexOf(
ScriptRuntime.toString(thisObj), args));
-
+
case Id_lastIndexOf:
return ScriptRuntime.wrapInt(js_lastIndexOf(
ScriptRuntime.toString(thisObj), args));
-
+
case Id_split:
return ScriptRuntime.checkRegExpProxy(cx).
js_split(cx, scope, ScriptRuntime.toString(thisObj),
args);
-
+
case Id_substring:
return js_substring(cx, ScriptRuntime.toString(thisObj), args);
-
+
case Id_toLowerCase:
// See ECMA 15.5.4.11
return ScriptRuntime.toString(thisObj).toLowerCase(
ScriptRuntime.ROOT_LOCALE);
-
+
case Id_toUpperCase:
// See ECMA 15.5.4.12
return ScriptRuntime.toString(thisObj).toUpperCase(
ScriptRuntime.ROOT_LOCALE);
-
+
case Id_substr:
return js_substr(ScriptRuntime.toString(thisObj), args);
-
+
case Id_concat:
return js_concat(ScriptRuntime.toString(thisObj), args);
-
+
case Id_slice:
return js_slice(ScriptRuntime.toString(thisObj), args);
-
+
case Id_bold:
return tagify(thisObj, "b", null, null);
-
+
case Id_italics:
return tagify(thisObj, "i", null, null);
-
+
case Id_fixed:
return tagify(thisObj, "tt", null, null);
-
+
case Id_strike:
return tagify(thisObj, "strike", null, null);
-
+
case Id_small:
return tagify(thisObj, "small", null, null);
-
+
case Id_big:
return tagify(thisObj, "big", null, null);
-
+
case Id_blink:
return tagify(thisObj, "blink", null, null);
-
+
case Id_sup:
return tagify(thisObj, "sup", null, null);
-
+
case Id_sub:
return tagify(thisObj, "sub", null, null);
-
+
case Id_fontsize:
return tagify(thisObj, "font", "size", args);
-
+
case Id_fontcolor:
return tagify(thisObj, "font", "color", args);
-
+
case Id_link:
return tagify(thisObj, "a", "href", args);
-
+
case Id_anchor:
return tagify(thisObj, "a", "name", args);
-
+
case Id_equals:
case Id_equalsIgnoreCase: {
String s1 = ScriptRuntime.toString(thisObj);
String s2 = ScriptRuntime.toString(args, 0);
return ScriptRuntime.wrapBoolean(
- (id == Id_equals) ? s1.equals(s2)
+ (id == Id_equals) ? s1.equals(s2)
: s1.equalsIgnoreCase(s2));
}
-
+
case Id_match:
case Id_search:
case Id_replace:
@@ -399,7 +399,7 @@ public Object execIdCall(IdFunctionObject f, Context cx, Scriptable scope,
collator.setStrength(Collator.IDENTICAL);
collator.setDecomposition(Collator.CANONICAL_DECOMPOSITION);
return ScriptRuntime.wrapNumber(collator.compare(
- ScriptRuntime.toString(thisObj),
+ ScriptRuntime.toString(thisObj),
ScriptRuntime.toString(args, 0)));
}
case Id_toLocaleLowerCase:
@@ -778,7 +778,7 @@ protected int findPrototypeId(String s)
// #/string_id_map#
- private static final int
+ private static final int
ConstructorId_charAt = -Id_charAt,
ConstructorId_charCodeAt = -Id_charCodeAt,
ConstructorId_indexOf = -Id_indexOf,
diff --git a/src/org/mozilla/javascript/NativeWith.java b/src/org/mozilla/javascript/NativeWith.java
index 080e9c44e5..cfaa49dcfd 100644
--- a/src/org/mozilla/javascript/NativeWith.java
+++ b/src/org/mozilla/javascript/NativeWith.java
@@ -48,7 +48,7 @@
* for operations on its parent.
*/
public class NativeWith implements Scriptable, IdFunctionCall, Serializable {
-
+
private static final long serialVersionUID = 1L;
static void init(Scriptable scope, boolean sealed)
diff --git a/src/org/mozilla/javascript/Node.java b/src/org/mozilla/javascript/Node.java
index 6544621eed..2d5414f126 100644
--- a/src/org/mozilla/javascript/Node.java
+++ b/src/org/mozilla/javascript/Node.java
@@ -95,7 +95,7 @@ public class Node implements Iterable
DESTRUCTURING_NAMES = 22,
DESTRUCTURING_PARAMS = 23,
JSDOC_PROP = 24,
- EXPRESSION_CLOSURE_PROP = 25, // JS 1.8 expression closure pseudo-return
+ EXPRESSION_CLOSURE_PROP = 25, // JS 1.8 expression closure pseudo-return
DESTRUCTURING_SHORTHAND = 26, // JS 1.8 destructuring shorthand
LAST_PROP = 26;
diff --git a/src/org/mozilla/javascript/NodeTransformer.java b/src/org/mozilla/javascript/NodeTransformer.java
index 9e42a00209..2ad6ce1754 100644
--- a/src/org/mozilla/javascript/NodeTransformer.java
+++ b/src/org/mozilla/javascript/NodeTransformer.java
@@ -139,7 +139,7 @@ private void transformCompilationUnit_r(final ScriptNode tree,
let.addChildToBack(oldNode);
}
}
-
+
switch (type) {
case Token.LABEL:
@@ -233,7 +233,7 @@ private void transformCompilationUnit_r(final ScriptNode tree,
returnNode = new Node(Token.RETURN_RESULT);
unwindBlock.addChildToBack(returnNode);
// transform return expression
- transformCompilationUnit_r(tree, store, scope,
+ transformCompilationUnit_r(tree, store, scope,
createScopeObjects,
inStrictMode);
}
@@ -353,7 +353,7 @@ private void transformCompilationUnit_r(final ScriptNode tree,
case Token.TYPEOF:
case Token.IFNE: {
/* We want to suppress warnings for undefined property o.p
- * for the following constructs: typeof o.p, if (o.p),
+ * for the following constructs: typeof o.p, if (o.p),
* if (!o.p), if (o.p == undefined), if (undefined == o.p)
*/
Node child = node.getFirstChild();
@@ -432,7 +432,7 @@ else if (last.getType() == Token.NAME &&
}
}
- transformCompilationUnit_r(tree, node,
+ transformCompilationUnit_r(tree, node,
node instanceof Scope ? (Scope)node : scope,
createScopeObjects, inStrictMode);
}
@@ -443,8 +443,8 @@ protected void visitNew(Node node, ScriptNode tree) {
protected void visitCall(Node node, ScriptNode tree) {
}
-
- protected Node visitLet(boolean createWith, Node parent, Node previous,
+
+ protected Node visitLet(boolean createWith, Node parent, Node previous,
Node scopeNode)
{
Node vars = scopeNode.getFirstChild();
diff --git a/src/org/mozilla/javascript/Parser.java b/src/org/mozilla/javascript/Parser.java
index 65694c8018..9f3ec46eb2 100644
--- a/src/org/mozilla/javascript/Parser.java
+++ b/src/org/mozilla/javascript/Parser.java
@@ -240,7 +240,7 @@ String lookupMessage(String messageId, String messageArg) {
? ScriptRuntime.getMessage0(messageId)
: ScriptRuntime.getMessage1(messageId, messageArg);
}
-
+
void reportError(String messageId) {
reportError(messageId, null);
}
@@ -541,7 +541,7 @@ private AstRoot parse() throws IOException
int baseLineno = ts.lineno; // line number where source starts
int end = pos; // in case source is empty
-
+
boolean inDirectivePrologue = true;
boolean savedStrictMode = inUseStrictDirective;
// TODO: eval code should get strict mode from invoking code
@@ -628,11 +628,11 @@ private AstNode parseFunctionBody()
++nestingOfFunction;
int pos = ts.tokenBeg;
Block pn = new Block(pos); // starts at LC position
-
+
boolean inDirectivePrologue = true;
boolean savedStrictMode = inUseStrictDirective;
// Don't set 'inUseStrictDirective' to false: inherit strict mode.
-
+
pn.setLineno(ts.lineno);
try {
bodyLoop: for (;;) {
@@ -676,7 +676,7 @@ private AstNode parseFunctionBody()
pn.setLength(end - pos);
return pn;
}
-
+
private String getDirective(AstNode n) {
if (n instanceof ExpressionStatement) {
AstNode e = ((ExpressionStatement) n).getExpression();
@@ -781,7 +781,7 @@ private FunctionNode function(int type)
if (inUseStrictDirective) {
String id = name.getIdentifier();
if ("eval".equals(id)|| "arguments".equals(id)) {
- reportError("msg.bad.id.strict", id);
+ reportError("msg.bad.id.strict", id);
}
}
if (!matchToken(Token.LP)) {
@@ -1896,7 +1896,7 @@ private VariableDeclaration variables(int declType, int pos)
String id = ts.getString();
if ("eval".equals(id) || "arguments".equals(ts.getString()))
{
- reportError("msg.bad.id.strict", id);
+ reportError("msg.bad.id.strict", id);
}
}
defineSymbol(declType, ts.getString(), inForInit);
@@ -2438,7 +2438,7 @@ private List argumentList()
} finally {
inForInit = wasInForInit;
}
-
+
mustMatchToken(Token.RP, "msg.no.paren.arg");
return result;
}
@@ -2834,7 +2834,7 @@ private AstNode primaryExpr()
s,
ts.getNumber());
}
-
+
case Token.STRING:
return createStringLiteral();
@@ -3156,7 +3156,7 @@ && peekToken() == Token.NAME
reportError("msg.bad.prop");
break;
}
-
+
if (this.inUseStrictDirective) {
if (propertyNames.contains(propertyName)) {
addError("msg.dup.obj.lit.prop.strict", propertyName);
@@ -3167,7 +3167,7 @@ && peekToken() == Token.NAME
// Eat any dangling jsdoc in the property.
getAndResetJsDoc();
jsdoc = null;
-
+
if (matchToken(Token.COMMA)) {
afterComma = ts.tokenEnd;
} else {
@@ -3766,7 +3766,7 @@ void markDestructuring(AstNode node) {
}
// throw a failed-assertion with some helpful debugging info
- private RuntimeException codeBug()
+ private RuntimeException codeBug()
throws RuntimeException
{
throw Kit.codeBug("ts.cursor=" + ts.cursor
diff --git a/src/org/mozilla/javascript/PolicySecurityController.java b/src/org/mozilla/javascript/PolicySecurityController.java
index 49cb1248da..d23e30c57d 100644
--- a/src/org/mozilla/javascript/PolicySecurityController.java
+++ b/src/org/mozilla/javascript/PolicySecurityController.java
@@ -52,11 +52,11 @@
/**
* A security controller relying on Java {@link Policy} in effect. When you use
* this security controller, your securityDomain objects must be instances of
- * {@link CodeSource} representing the location from where you load your
+ * {@link CodeSource} representing the location from where you load your
* scripts. Any Java policy "grant" statements matching the URL and certificate
- * in code sources will apply to the scripts. If you specify any certificates
+ * in code sources will apply to the scripts. If you specify any certificates
* within your {@link CodeSource} objects, it is your responsibility to verify
- * (or not) that the script source files are signed in whatever
+ * (or not) that the script source files are signed in whatever
* implementation-specific way you're using.
* @author Attila Szegedi
*/
@@ -71,7 +71,7 @@ public class PolicySecurityController extends SecurityController
private static final Map>>
callers =
new WeakHashMap>>();
-
+
@Override
public Class> getStaticSecurityDomainClassInternal() {
return CodeSource.class;
@@ -81,7 +81,7 @@ private static class Loader extends SecureClassLoader
implements GeneratedClassLoader
{
private final CodeSource codeSource;
-
+
Loader(ClassLoader parent, CodeSource codeSource)
{
super(parent);
@@ -92,15 +92,15 @@ public Class> defineClass(String name, byte[] data)
{
return defineClass(name, data, 0, data.length, codeSource);
}
-
+
public void linkClass(Class> cl)
{
resolveClass(cl);
}
}
-
+
@Override
- public GeneratedClassLoader createClassLoader(final ClassLoader parent,
+ public GeneratedClassLoader createClassLoader(final ClassLoader parent,
final Object securityDomain)
{
return (Loader)AccessController.doPrivileged(
@@ -122,11 +122,11 @@ public Object getDynamicSecurityDomain(Object securityDomain)
}
@Override
- public Object callWithDomain(final Object securityDomain, final Context cx,
- Callable callable, Scriptable scope, Scriptable thisObj,
+ public Object callWithDomain(final Object securityDomain, final Context cx,
+ Callable callable, Scriptable scope, Scriptable thisObj,
Object[] args)
{
- // Run in doPrivileged as we might be checked for "getClassLoader"
+ // Run in doPrivileged as we might be checked for "getClassLoader"
// runtime permission
final ClassLoader classLoader = (ClassLoader)AccessController.doPrivileged(
new PrivilegedAction