Skip to content

Commit

Permalink
fix a bunch of typos
Browse files Browse the repository at this point in the history
  • Loading branch information
rbri committed Sep 29, 2024
1 parent f962958 commit 95f232f
Show file tree
Hide file tree
Showing 34 changed files with 53 additions and 53 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ public static Object reduceMethod(
continue;
}
if (value == NOT_FOUND) {
// no initial value passed, use first element found as inital value
// no initial value passed, use first element found as initial value
value = elem;
} else {
Object[] innerArgs = {value, elem, index, o};
Expand Down
4 changes: 2 additions & 2 deletions rhino/src/main/java/org/mozilla/javascript/BaseFunction.java
Original file line number Diff line number Diff line change
Expand Up @@ -443,8 +443,8 @@ public Scriptable construct(Context cx, Scriptable scope, Object[] args) {
}

/**
* Creates new script object. The default implementation of {@link #construct} uses the method
* to to get the value for <code>thisObj</code> argument when invoking {@link #call}. The methos
* Creates new script object. The default implementation of {@link #construct} uses this method
* to to get the value for <code>thisObj</code> argument when invoking {@link #call}. The method
* is allowed to return <code>null</code> to indicate that {@link #call} will create a new
* object itself. In this case {@link #construct} will set scope and prototype on the result
* {@link #call} unless they are already set.
Expand Down
4 changes: 2 additions & 2 deletions rhino/src/main/java/org/mozilla/javascript/Context.java
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ public class Context implements Closeable {
* when applied to objects and arrays. If <code>hasFeature(FEATURE_TO_STRING_AS_SOURCE)</code>
* returns true, calling <code>toString()</code> on JS objects gives the same result as calling
* <code>toSource()</code>. That is it returns JS source with code to create an object with all
* enumeratable fields of the original object instead of printing <code>[object <i>result of
* enumerable fields of the original object instead of printing <code>[object <i>result of
* {@link Scriptable#getClassName()}</i>]</code>.
*
* <p>By default {@link #hasFeature(int)} returns true only if the current JS version is set to
Expand Down Expand Up @@ -622,7 +622,7 @@ public final void seal(Object sealKey) {

/**
* Unseal previously sealed Context object. The <code>sealKey</code> argument should not be null
* and should match <code>sealKey</code> suplied with the last call to {@link #seal(Object)} or
* and should match <code>sealKey</code> supplied with the last call to {@link #seal(Object)} or
* an exception will be thrown.
*
* @see #isSealed()
Expand Down
2 changes: 1 addition & 1 deletion rhino/src/main/java/org/mozilla/javascript/DToA.java
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ static int word1(double d) {
return (int) dBits;
}

/* Return b * 5^k. k must be nonnegative. */
/* Return b * 5^k. k must be non negative. */
// XXXX the C version built a cache of these
static BigInteger pow5mult(BigInteger b, int k) {
return b.multiply(BigInteger.valueOf(5).pow(k));
Expand Down
6 changes: 3 additions & 3 deletions rhino/src/main/java/org/mozilla/javascript/ErrorReporter.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public interface ErrorReporter {
* <p>The implementing class may choose to ignore the warning if it desires.
*
* @param message a String describing the warning
* @param sourceName a String describing the JavaScript source where the warning occured;
* @param sourceName a String describing the JavaScript source where the warning occurred;
* typically a filename or URL
* @param line the line number associated with the warning
* @param lineSource the text of the line (may be null)
Expand All @@ -40,7 +40,7 @@ public interface ErrorReporter {
* however.
*
* @param message a String describing the error
* @param sourceName a String describing the JavaScript source where the error occured;
* @param sourceName a String describing the JavaScript source where the error occurred;
* typically a filename or URL
* @param line the line number associated with the error
* @param lineSource the text of the line (may be null)
Expand All @@ -54,7 +54,7 @@ public interface ErrorReporter {
* <p>runtimeErrors, unlike errors, will always terminate the current script.
*
* @param message a String describing the error
* @param sourceName a String describing the JavaScript source where the error occured;
* @param sourceName a String describing the JavaScript source where the error occurred;
* typically a filename or URL
* @param line the line number associated with the error
* @param lineSource the text of the line (may be null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public EvaluatorException(String detail) {
* <p>Errors internal to the JavaScript engine will simply throw a RuntimeException.
*
* @param detail the error message
* @param sourceName the name of the source reponsible for the error
* @param sourceName the name of the source responsible for the error
* @param lineNumber the line number of the source
*/
public EvaluatorException(String detail, String sourceName, int lineNumber) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ public FunctionObject(String name, Member methodOrConstructor, Scriptable scope)

/**
* @return One of <code>JAVA_*_TYPE</code> constants to indicate desired type or {@link
* #JAVA_UNSUPPORTED_TYPE} if the convertion is not possible
* #JAVA_UNSUPPORTED_TYPE} if the conversion is not possible
*/
public static int getTypeTag(Class<?> type) {
if (type == ScriptRuntime.StringClass) return JAVA_STRING_TYPE;
Expand Down
12 changes: 6 additions & 6 deletions rhino/src/main/java/org/mozilla/javascript/IRFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -1118,7 +1118,7 @@ private Node transformTry(TryStatement node) {
private Node transformUnary(UnaryExpression node) {
int type = node.getType();
if (type == Token.DEFAULTNAMESPACE) {
return transformDefaultXmlNamepace(node);
return transformDefaultXmlNamespace(node);
}

Node child = transform(node.getOperand());
Expand Down Expand Up @@ -1274,7 +1274,7 @@ private Node transformXmlRef(Node pn, XmlRef node, int memberTypeFlags) {
return createElementGet(pn, ns, expr, memberTypeFlags);
}

private Node transformDefaultXmlNamepace(UnaryExpression node) {
private Node transformDefaultXmlNamespace(UnaryExpression node) {
Node child = transform(node.getOperand());
return createUnary(Token.DEFAULTNAMESPACE, child);
}
Expand Down Expand Up @@ -1645,10 +1645,10 @@ private Node createTryCatchFinally(
// after_catch:
//
// If there is no default catch, then the last with block
// arround "somethingDefault;" is replaced by "rethrow;"
// around "somethingDefault;" is replaced by "rethrow;"

// It is assumed that catch handler generation will store
// exeception object in handlerBlock register
// exception object in handlerBlock register

// Block with local for exception scope objects
Node catchScopeBlock = new Node(Token.LOCAL_BLOCK);
Expand Down Expand Up @@ -2008,7 +2008,7 @@ private static Node createBinary(int nodeType, Node left, Node right) {
}
// can't do anything if we don't know both types - since
// 0 + object is supposed to call toString on the object and do
// string concantenation rather than addition
// string concatenation rather than addition
break;

case Token.SUB:
Expand Down Expand Up @@ -2064,7 +2064,7 @@ private static Node createBinary(int nodeType, Node left, Node right) {
return left;
} else if (rd == 1.0) {
// second 1: x/1 -> +x
// not simply x to force number convertion
// not simply x to force number conversion
return new Node(Token.POS, left);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ final void initValue(int id, String name, Object value, int attributes) {
if (id == constructorId) {
if (!(value instanceof IdFunctionObject)) {
throw new IllegalArgumentException(
"consructor should be initialized with IdFunctionObject");
"constructor should be initialized with IdFunctionObject");
}
constructor = (IdFunctionObject) value;
constructorAttrs = (short) attributes;
Expand All @@ -86,7 +86,7 @@ final void initValue(int id, Symbol key, Object value, int attributes) {
if (id == constructorId) {
if (!(value instanceof IdFunctionObject)) {
throw new IllegalArgumentException(
"consructor should be initialized with IdFunctionObject");
"constructor should be initialized with IdFunctionObject");
}
constructor = (IdFunctionObject) value;
constructorAttrs = (short) attributes;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3305,7 +3305,7 @@ private static CallFrame processThrowable(
// Continuation jump is almost done: capturedFrame
// points to the call to the function that captured
// continuation, so clone capturedFrame and
// emulate return that function with the suplied result
// emulate return that function with the supplied result
frame = cjump.capturedFrame.cloneFrozen();
setCallResult(frame, cjump.result, cjump.resultDbl);
// restart the execution
Expand Down
6 changes: 3 additions & 3 deletions rhino/src/main/java/org/mozilla/javascript/JavaAdapter.java
Original file line number Diff line number Diff line change
Expand Up @@ -943,13 +943,13 @@ private static void generateMethod(
throw Context.reportRuntimeErrorById(
"JavaAdapter can not subclass methods with more then" + " 64 arguments.");
}
long convertionMask = 0;
long conversionMask = 0;
for (int i = 0; i != parms.length; ++i) {
if (!parms[i].isPrimitive()) {
convertionMask |= (1 << i);
conversionMask |= (1 << i);
}
}
cfw.addPush(convertionMask);
cfw.addPush(conversionMask);

// go through utility method, which creates a Context to run the
// method in.
Expand Down
2 changes: 1 addition & 1 deletion rhino/src/main/java/org/mozilla/javascript/Kit.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ static boolean testIfCanLoadRhinoClasses(ClassLoader loader) {

/**
* If character <code>c</code> is a hexadecimal digit, return <code>accumulator</code> * 16 plus
* corresponding number. Otherise return -1.
* corresponding number. Otherwise return -1.
*/
public static int xDigitToInt(int c, int accumulator) {
check:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -323,9 +323,9 @@ static int findFunction(Context cx, MemberBox[] methodsOrCtors, Object[] args) {
// The loop starts from -1 denoting firstBestFit and proceed
// until extraBestFitsCount to avoid extraBestFits allocation
// in the most common case of no ambiguity
int betterCount = 0; // number of times member was prefered over
int betterCount = 0; // number of times member was preferred over
// best fits
int worseCount = 0; // number of times best fits were prefered
int worseCount = 0; // number of times best fits were preferred
// over member
for (int j = -1; j != extraBestFitsCount; ++j) {
int bestFitIndex;
Expand Down Expand Up @@ -386,12 +386,12 @@ static int findFunction(Context cx, MemberBox[] methodsOrCtors, Object[] args) {
}
}
if (betterCount == 1 + extraBestFitsCount) {
// member was prefered over all best fits
// member was preferred over all best fits
if (debug) printDebug("New first applicable ", member, args);
firstBestFit = i;
extraBestFitsCount = 0;
} else if (worseCount == 1 + extraBestFitsCount) {
// all best fits were prefered over member, ignore it
// all best fits were preferred over member, ignore it
if (debug) printDebug("Rejecting (all current bests better) ", member, args);
} else {
// some ambiguity was present, add member to best fit set
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,7 @@ private static Object coerceToNumber(Class<?> type, Object value) {
/* Long values cannot be expressed exactly in doubles.
* We thus use the largest and smallest double value that
* has a value expressible as a long value. We build these
* numerical values from their hexidecimal representations
* numerical values from their hexadecimal representations
* to avoid any problems caused by attempting to parse a
* decimal representation.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

/**
* This is an implementation of the ES6 WeakMap class. As per the spec, keys must be ordinary
* objects. Since there is no defined "equality" for objects, comparisions are done strictly by
* objects. Since there is no defined "equality" for objects, comparisons are done strictly by
* object equality. Both ES6 and the java.util.WeakHashMap class have the same basic structure --
* entries are removed automatically when the sole remaining reference to the key is a weak
* reference. Therefore, we can use WeakHashMap as the basis of this implementation and preserve the
Expand Down
2 changes: 1 addition & 1 deletion rhino/src/main/java/org/mozilla/javascript/Node.java
Original file line number Diff line number Diff line change
Expand Up @@ -807,7 +807,7 @@ private int endCheckBlock() {
Node n;
int rv = END_DROPS_OFF;

// check each statment and if the statement can continue onto the next
// check each statement and if the statement can continue onto the next
// one, then check the next statement
for (n = first; ((rv & END_DROPS_OFF) != 0) && n != null; n = n.next) {
rv &= ~END_DROPS_OFF;
Expand Down
2 changes: 1 addition & 1 deletion rhino/src/main/java/org/mozilla/javascript/SlotMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public interface SlotComputer<S extends Slot> {
* Replace the value of key with the slot computed by the "compute" method. If "compute" throws
* an exception, make no change. If "compute" returns null, remove the mapping, otherwise,
* replace any existing mapping with the result of "compute", and create a new mapping if none
* exists. This is equivalant to the "compute" method on the Map interface, which simplifies
* exists. This is equivalent to the "compute" method on the Map interface, which simplifies
* code and is more efficient than making multiple calls to this interface. In order to allow
* use of multiple Slot subclasses, this function is templatized.
*/
Expand Down
2 changes: 1 addition & 1 deletion rhino/src/main/java/org/mozilla/javascript/StackStyle.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public enum StackStyle {
MOZILLA,

/**
* This is the same as MOZILLA but uses LF as speparator instead of the system dependent line
* This is the same as MOZILLA but uses LF as separator instead of the system dependent line
* separator.
*/
MOZILLA_LF,
Expand Down
2 changes: 1 addition & 1 deletion rhino/src/main/java/org/mozilla/javascript/Symbol.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
package org.mozilla.javascript;

/**
* A Symbol is a JavaScript objecy that obeys the special properties of the Symbol prototype. This
* A Symbol is a JavaScript object that obeys the special properties of the Symbol prototype. This
* interface lets us possibly support multiple implementations of Symbol.
*
* @since 1.7.8
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2244,7 +2244,7 @@ private final int charAt(int index) {
// ignore it, we're already displaying an error...
return EOF_CHAR;
}
// index recalculuation as fillSourceBuffer can move saved
// index recalculation as fillSourceBuffer can move saved
// line buffer and change sourceCursor
index -= (oldSourceCursor - sourceCursor);
}
Expand Down
6 changes: 3 additions & 3 deletions rhino/src/main/java/org/mozilla/javascript/TopLevel.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
*
* <p>Calling {@link org.mozilla.javascript.Context#initStandardObjects()} with an instance of this
* class as argument will automatically cache built-in classes after initialization. For other
* setups involving top-level scopes that inherit global properties from their proptotypes (e.g.
* with dynamic scopes) embeddings should explicitly call {@link #cacheBuiltins(Scriptable,
* boolean)} to initialize the class cache for each top-level scope.
* setups involving top-level scopes that inherit global properties from their prototypes (e.g. with
* dynamic scopes) embeddings should explicitly call {@link #cacheBuiltins(Scriptable, boolean)} to
* initialize the class cache for each top-level scope.
*/
public class TopLevel extends IdScriptableObject {

Expand Down
2 changes: 1 addition & 1 deletion rhino/src/main/java/org/mozilla/javascript/Undefined.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public int hashCode() {
/**
* An alternate representation of undefined, to be used only when we need to pass it to a method
* that takes as Scriptable as a parameter. This is used when we need to pass undefined as the
* "this" parmeter of a Callable instance, because we cannot change that interface without
* "this" parameter of a Callable instance, because we cannot change that interface without
* breaking backward compatibility.
*/
public static final Scriptable SCRIPTABLE_UNDEFINED =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

/**
* An annotation that marks a Java method as JavaScript constructor. This can be used as an
* alternative to the <code>jsConstructor</code> naming convention desribed in {@link
* alternative to the <code>jsConstructor</code> naming convention described in {@link
* org.mozilla.javascript.ScriptableObject#defineClass(org.mozilla.javascript.Scriptable,
* java.lang.Class)}.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

/**
* An annotation that marks a Java method as JavaScript function. This can be used as an alternative
* to the <code>jsFunction_</code> prefix desribed in {@link
* to the <code>jsFunction_</code> prefix described in {@link
* org.mozilla.javascript.ScriptableObject#defineClass(org.mozilla.javascript.Scriptable,
* java.lang.Class)}.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

/**
* An annotation that marks a Java method as JavaScript getter. This can be used as an alternative
* to the <code>jsGet_</code> prefix desribed in {@link
* to the <code>jsGet_</code> prefix described in {@link
* org.mozilla.javascript.ScriptableObject#defineClass(org.mozilla.javascript.Scriptable,
* java.lang.Class)}.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

/**
* An annotation that marks a Java method as JavaScript setter. This can be used as an alternative
* to the <code>jsSet_</code> prefix desribed in {@link
* to the <code>jsSet_</code> prefix described in {@link
* org.mozilla.javascript.ScriptableObject#defineClass(org.mozilla.javascript.Scriptable,
* java.lang.Class)}.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

/**
* An annotation that marks a Java method as JavaScript static function. This can be used as an
* alternative to the <code>jsStaticFunction_</code> prefix desribed in {@link
* alternative to the <code>jsStaticFunction_</code> prefix described in {@link
* org.mozilla.javascript.ScriptableObject#defineClass(org.mozilla.javascript.Scriptable,
* java.lang.Class)}.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ public Scope getEnclosingScope() {
* @param other another node
* @return -1 if this node's start position is less than {@code other}'s start position. If
* tied, -1 if this node's length is less than {@code other}'s length. If the lengths are
* equal, sorts abitrarily on hashcode unless the nodes are the same per {@link #equals}.
* equal, sorts arbitrarily on hashcode unless the nodes are the same per {@link #equals}.
*/
@Override
public int compareTo(AstNode other) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public interface IdeErrorReporter extends ErrorReporter {
*
* @param message a {@code String} describing the warning
* @param sourceName a {@code String} describing the JavaScript source where the warning
* occured; typically a filename or URL
* occurred; typically a filename or URL
* @param offset the warning's 0-indexed char position in the input stream
* @param length the length of the region contributing to the warning
*/
Expand All @@ -53,7 +53,7 @@ public interface IdeErrorReporter extends ErrorReporter {
* <p>
*
* @param message a String describing the error
* @param sourceName a String describing the JavaScript source where the error occured;
* @param sourceName a String describing the JavaScript source where the error occurred;
* typically a filename or URL
* @param offset 0-indexed char position of the error in the input stream
* @param length the length of the region contributing to the error
Expand Down
Loading

0 comments on commit 95f232f

Please sign in to comment.