id int32 0 165k | repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 |
|---|---|---|---|---|---|---|---|---|---|---|---|
21,500 | mozilla/rhino | src/org/mozilla/javascript/ScriptRuntime.java | ScriptRuntime.indexFromString | public static long indexFromString(String str)
{
// The length of the decimal string representation of
// Integer.MAX_VALUE, 2147483647
final int MAX_VALUE_LENGTH = 10;
int len = str.length();
if (len > 0) {
int i = 0;
boolean negate = false;
... | java | public static long indexFromString(String str)
{
// The length of the decimal string representation of
// Integer.MAX_VALUE, 2147483647
final int MAX_VALUE_LENGTH = 10;
int len = str.length();
if (len > 0) {
int i = 0;
boolean negate = false;
... | [
"public",
"static",
"long",
"indexFromString",
"(",
"String",
"str",
")",
"{",
"// The length of the decimal string representation of",
"// Integer.MAX_VALUE, 2147483647",
"final",
"int",
"MAX_VALUE_LENGTH",
"=",
"10",
";",
"int",
"len",
"=",
"str",
".",
"length",
"(",... | Return -1L if str is not an index, or the index value as lower 32
bits of the result. Note that the result needs to be cast to an int
in order to produce the actual index, which may be negative. | [
"Return",
"-",
"1L",
"if",
"str",
"is",
"not",
"an",
"index",
"or",
"the",
"index",
"value",
"as",
"lower",
"32",
"bits",
"of",
"the",
"result",
".",
"Note",
"that",
"the",
"result",
"needs",
"to",
"be",
"cast",
"to",
"an",
"int",
"in",
"order",
"t... | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ScriptRuntime.java#L1363-L1414 |
21,501 | mozilla/rhino | src/org/mozilla/javascript/ScriptRuntime.java | ScriptRuntime.getIndexObject | static Object getIndexObject(String s)
{
long indexTest = indexFromString(s);
if (indexTest >= 0) {
return Integer.valueOf((int)indexTest);
}
return s;
} | java | static Object getIndexObject(String s)
{
long indexTest = indexFromString(s);
if (indexTest >= 0) {
return Integer.valueOf((int)indexTest);
}
return s;
} | [
"static",
"Object",
"getIndexObject",
"(",
"String",
"s",
")",
"{",
"long",
"indexTest",
"=",
"indexFromString",
"(",
"s",
")",
";",
"if",
"(",
"indexTest",
">=",
"0",
")",
"{",
"return",
"Integer",
".",
"valueOf",
"(",
"(",
"int",
")",
"indexTest",
")... | If s represents index, then return index value wrapped as Integer
and othewise return s. | [
"If",
"s",
"represents",
"index",
"then",
"return",
"index",
"value",
"wrapped",
"as",
"Integer",
"and",
"othewise",
"return",
"s",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ScriptRuntime.java#L1456-L1463 |
21,502 | mozilla/rhino | src/org/mozilla/javascript/ScriptRuntime.java | ScriptRuntime.getIndexObject | static Object getIndexObject(double d)
{
int i = (int)d;
if (i == d) {
return Integer.valueOf(i);
}
return toString(d);
} | java | static Object getIndexObject(double d)
{
int i = (int)d;
if (i == d) {
return Integer.valueOf(i);
}
return toString(d);
} | [
"static",
"Object",
"getIndexObject",
"(",
"double",
"d",
")",
"{",
"int",
"i",
"=",
"(",
"int",
")",
"d",
";",
"if",
"(",
"i",
"==",
"d",
")",
"{",
"return",
"Integer",
".",
"valueOf",
"(",
"i",
")",
";",
"}",
"return",
"toString",
"(",
"d",
"... | If d is exact int value, return its value wrapped as Integer
and othewise return d converted to String. | [
"If",
"d",
"is",
"exact",
"int",
"value",
"return",
"its",
"value",
"wrapped",
"as",
"Integer",
"and",
"othewise",
"return",
"d",
"converted",
"to",
"String",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ScriptRuntime.java#L1469-L1476 |
21,503 | mozilla/rhino | src/org/mozilla/javascript/ScriptRuntime.java | ScriptRuntime.name | public static Object name(Context cx, Scriptable scope, String name)
{
Scriptable parent = scope.getParentScope();
if (parent == null) {
Object result = topScopeName(cx, scope, name);
if (result == Scriptable.NOT_FOUND) {
throw notFoundError(scope, name);
... | java | public static Object name(Context cx, Scriptable scope, String name)
{
Scriptable parent = scope.getParentScope();
if (parent == null) {
Object result = topScopeName(cx, scope, name);
if (result == Scriptable.NOT_FOUND) {
throw notFoundError(scope, name);
... | [
"public",
"static",
"Object",
"name",
"(",
"Context",
"cx",
",",
"Scriptable",
"scope",
",",
"String",
"name",
")",
"{",
"Scriptable",
"parent",
"=",
"scope",
".",
"getParentScope",
"(",
")",
";",
"if",
"(",
"parent",
"==",
"null",
")",
"{",
"Object",
... | Looks up a name in the scope chain and returns its value. | [
"Looks",
"up",
"a",
"name",
"in",
"the",
"scope",
"chain",
"and",
"returns",
"its",
"value",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ScriptRuntime.java#L1929-L1941 |
21,504 | mozilla/rhino | src/org/mozilla/javascript/ScriptRuntime.java | ScriptRuntime.bind | public static Scriptable bind(Context cx, Scriptable scope, String id)
{
Scriptable firstXMLObject = null;
Scriptable parent = scope.getParentScope();
childScopesChecks: if (parent != null) {
// Check for possibly nested "with" scopes first
while (scope instanceof Nat... | java | public static Scriptable bind(Context cx, Scriptable scope, String id)
{
Scriptable firstXMLObject = null;
Scriptable parent = scope.getParentScope();
childScopesChecks: if (parent != null) {
// Check for possibly nested "with" scopes first
while (scope instanceof Nat... | [
"public",
"static",
"Scriptable",
"bind",
"(",
"Context",
"cx",
",",
"Scriptable",
"scope",
",",
"String",
"id",
")",
"{",
"Scriptable",
"firstXMLObject",
"=",
"null",
";",
"Scriptable",
"parent",
"=",
"scope",
".",
"getParentScope",
"(",
")",
";",
"childSco... | Returns the object in the scope chain that has a given property.
The order of evaluation of an assignment expression involves
evaluating the lhs to a reference, evaluating the rhs, and then
modifying the reference with the rhs value. This method is used
to 'bind' the given name to an object containing that property
so... | [
"Returns",
"the",
"object",
"in",
"the",
"scope",
"chain",
"that",
"has",
"a",
"given",
"property",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ScriptRuntime.java#L2048-L2096 |
21,505 | mozilla/rhino | src/org/mozilla/javascript/ScriptRuntime.java | ScriptRuntime.enumInit | @Deprecated
public static Object enumInit(Object value, Context cx, boolean enumValues)
{
return enumInit(value, cx, enumValues ? ENUMERATE_VALUES
: ENUMERATE_KEYS);
} | java | @Deprecated
public static Object enumInit(Object value, Context cx, boolean enumValues)
{
return enumInit(value, cx, enumValues ? ENUMERATE_VALUES
: ENUMERATE_KEYS);
} | [
"@",
"Deprecated",
"public",
"static",
"Object",
"enumInit",
"(",
"Object",
"value",
",",
"Context",
"cx",
",",
"boolean",
"enumValues",
")",
"{",
"return",
"enumInit",
"(",
"value",
",",
"cx",
",",
"enumValues",
"?",
"ENUMERATE_VALUES",
":",
"ENUMERATE_KEYS",... | For backwards compatibility with generated class files
@deprecated Use {@link #enumInit(Object, Context, Scriptable, int)} instead | [
"For",
"backwards",
"compatibility",
"with",
"generated",
"class",
"files"
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ScriptRuntime.java#L2215-L2220 |
21,506 | mozilla/rhino | src/org/mozilla/javascript/ScriptRuntime.java | ScriptRuntime.newObject | public static Scriptable newObject(Object fun, Context cx,
Scriptable scope, Object[] args)
{
if (!(fun instanceof Function)) {
throw notFunctionError(fun);
}
Function function = (Function)fun;
return function.construct(cx, scope, ar... | java | public static Scriptable newObject(Object fun, Context cx,
Scriptable scope, Object[] args)
{
if (!(fun instanceof Function)) {
throw notFunctionError(fun);
}
Function function = (Function)fun;
return function.construct(cx, scope, ar... | [
"public",
"static",
"Scriptable",
"newObject",
"(",
"Object",
"fun",
",",
"Context",
"cx",
",",
"Scriptable",
"scope",
",",
"Object",
"[",
"]",
"args",
")",
"{",
"if",
"(",
"!",
"(",
"fun",
"instanceof",
"Function",
")",
")",
"{",
"throw",
"notFunctionEr... | Operator new.
See ECMA 11.2.2 | [
"Operator",
"new",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ScriptRuntime.java#L2666-L2674 |
21,507 | mozilla/rhino | src/org/mozilla/javascript/ScriptRuntime.java | ScriptRuntime.applyOrCall | public static Object applyOrCall(boolean isApply,
Context cx, Scriptable scope,
Scriptable thisObj, Object[] args)
{
int L = args.length;
Callable function = getCallable(thisObj);
Scriptable callThis = null;
i... | java | public static Object applyOrCall(boolean isApply,
Context cx, Scriptable scope,
Scriptable thisObj, Object[] args)
{
int L = args.length;
Callable function = getCallable(thisObj);
Scriptable callThis = null;
i... | [
"public",
"static",
"Object",
"applyOrCall",
"(",
"boolean",
"isApply",
",",
"Context",
"cx",
",",
"Scriptable",
"scope",
",",
"Scriptable",
"thisObj",
",",
"Object",
"[",
"]",
"args",
")",
"{",
"int",
"L",
"=",
"args",
".",
"length",
";",
"Callable",
"f... | Function.prototype.apply and Function.prototype.call
See Ecma 15.3.4.[34] | [
"Function",
".",
"prototype",
".",
"apply",
"and",
"Function",
".",
"prototype",
".",
"call"
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ScriptRuntime.java#L2723-L2758 |
21,508 | mozilla/rhino | src/org/mozilla/javascript/ScriptRuntime.java | ScriptRuntime.evalSpecial | public static Object evalSpecial(Context cx, Scriptable scope,
Object thisArg, Object[] args,
String filename, int lineNumber)
{
if (args.length < 1)
return Undefined.instance;
Object x = args[0];
if (!(x i... | java | public static Object evalSpecial(Context cx, Scriptable scope,
Object thisArg, Object[] args,
String filename, int lineNumber)
{
if (args.length < 1)
return Undefined.instance;
Object x = args[0];
if (!(x i... | [
"public",
"static",
"Object",
"evalSpecial",
"(",
"Context",
"cx",
",",
"Scriptable",
"scope",
",",
"Object",
"thisArg",
",",
"Object",
"[",
"]",
"args",
",",
"String",
"filename",
",",
"int",
"lineNumber",
")",
"{",
"if",
"(",
"args",
".",
"length",
"<"... | The eval function property of the global object.
See ECMA 15.1.2.1 | [
"The",
"eval",
"function",
"property",
"of",
"the",
"global",
"object",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ScriptRuntime.java#L2805-L2850 |
21,509 | mozilla/rhino | src/org/mozilla/javascript/ScriptRuntime.java | ScriptRuntime.typeof | public static String typeof(Object value)
{
if (value == null)
return "object";
if (value == Undefined.instance)
return "undefined";
if (value instanceof ScriptableObject)
return ((ScriptableObject) value).getTypeOf();
if (value instanceof Scriptab... | java | public static String typeof(Object value)
{
if (value == null)
return "object";
if (value == Undefined.instance)
return "undefined";
if (value instanceof ScriptableObject)
return ((ScriptableObject) value).getTypeOf();
if (value instanceof Scriptab... | [
"public",
"static",
"String",
"typeof",
"(",
"Object",
"value",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"return",
"\"object\"",
";",
"if",
"(",
"value",
"==",
"Undefined",
".",
"instance",
")",
"return",
"\"undefined\"",
";",
"if",
"(",
"value",... | The typeof operator | [
"The",
"typeof",
"operator"
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ScriptRuntime.java#L2855-L2872 |
21,510 | mozilla/rhino | src/org/mozilla/javascript/ScriptRuntime.java | ScriptRuntime.typeofName | public static String typeofName(Scriptable scope, String id)
{
Context cx = Context.getContext();
Scriptable val = bind(cx, scope, id);
if (val == null)
return "undefined";
return typeof(getObjectProp(val, id, cx));
} | java | public static String typeofName(Scriptable scope, String id)
{
Context cx = Context.getContext();
Scriptable val = bind(cx, scope, id);
if (val == null)
return "undefined";
return typeof(getObjectProp(val, id, cx));
} | [
"public",
"static",
"String",
"typeofName",
"(",
"Scriptable",
"scope",
",",
"String",
"id",
")",
"{",
"Context",
"cx",
"=",
"Context",
".",
"getContext",
"(",
")",
";",
"Scriptable",
"val",
"=",
"bind",
"(",
"cx",
",",
"scope",
",",
"id",
")",
";",
... | The typeof operator that correctly handles the undefined case | [
"The",
"typeof",
"operator",
"that",
"correctly",
"handles",
"the",
"undefined",
"case"
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ScriptRuntime.java#L2877-L2884 |
21,511 | mozilla/rhino | src/org/mozilla/javascript/ScriptRuntime.java | ScriptRuntime.nameIncrDecr | @Deprecated
public static Object nameIncrDecr(Scriptable scopeChain, String id,
int incrDecrMask)
{
return nameIncrDecr(scopeChain, id, Context.getContext(), incrDecrMask);
} | java | @Deprecated
public static Object nameIncrDecr(Scriptable scopeChain, String id,
int incrDecrMask)
{
return nameIncrDecr(scopeChain, id, Context.getContext(), incrDecrMask);
} | [
"@",
"Deprecated",
"public",
"static",
"Object",
"nameIncrDecr",
"(",
"Scriptable",
"scopeChain",
",",
"String",
"id",
",",
"int",
"incrDecrMask",
")",
"{",
"return",
"nameIncrDecr",
"(",
"scopeChain",
",",
"id",
",",
"Context",
".",
"getContext",
"(",
")",
... | The method is only present for compatibility.
@deprecated Use {@link #nameIncrDecr(Scriptable, String, Context, int)} instead | [
"The",
"method",
"is",
"only",
"present",
"for",
"compatibility",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ScriptRuntime.java#L2963-L2968 |
21,512 | mozilla/rhino | src/org/mozilla/javascript/ScriptRuntime.java | ScriptRuntime.sameZero | public static boolean sameZero(Object x, Object y) {
if (!typeof(x).equals(typeof(y))) {
return false;
}
if (x instanceof Number) {
if (isNaN(x) && isNaN(y)) {
return true;
}
final double dx = ((Number)x).doubleValue();
... | java | public static boolean sameZero(Object x, Object y) {
if (!typeof(x).equals(typeof(y))) {
return false;
}
if (x instanceof Number) {
if (isNaN(x) && isNaN(y)) {
return true;
}
final double dx = ((Number)x).doubleValue();
... | [
"public",
"static",
"boolean",
"sameZero",
"(",
"Object",
"x",
",",
"Object",
"y",
")",
"{",
"if",
"(",
"!",
"typeof",
"(",
"x",
")",
".",
"equals",
"(",
"typeof",
"(",
"y",
")",
")",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"x",
"inst... | Implement "SameValueZero" from ECMA 7.2.9 | [
"Implement",
"SameValueZero",
"from",
"ECMA",
"7",
".",
"2",
".",
"9"
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ScriptRuntime.java#L3261-L3280 |
21,513 | mozilla/rhino | src/org/mozilla/javascript/ScriptRuntime.java | ScriptRuntime.instanceOf | public static boolean instanceOf(Object a, Object b, Context cx)
{
// Check RHS is an object
if (! (b instanceof Scriptable)) {
throw typeError0("msg.instanceof.not.object");
}
// for primitive values on LHS, return false
if (! (a instanceof Scriptable))
... | java | public static boolean instanceOf(Object a, Object b, Context cx)
{
// Check RHS is an object
if (! (b instanceof Scriptable)) {
throw typeError0("msg.instanceof.not.object");
}
// for primitive values on LHS, return false
if (! (a instanceof Scriptable))
... | [
"public",
"static",
"boolean",
"instanceOf",
"(",
"Object",
"a",
",",
"Object",
"b",
",",
"Context",
"cx",
")",
"{",
"// Check RHS is an object",
"if",
"(",
"!",
"(",
"b",
"instanceof",
"Scriptable",
")",
")",
"{",
"throw",
"typeError0",
"(",
"\"msg.instance... | The instanceof operator.
@return a instanceof b | [
"The",
"instanceof",
"operator",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ScriptRuntime.java#L3403-L3415 |
21,514 | mozilla/rhino | src/org/mozilla/javascript/ScriptRuntime.java | ScriptRuntime.in | public static boolean in(Object a, Object b, Context cx)
{
if (!(b instanceof Scriptable)) {
throw typeError0("msg.in.not.object");
}
return hasObjectElem((Scriptable)b, a, cx);
} | java | public static boolean in(Object a, Object b, Context cx)
{
if (!(b instanceof Scriptable)) {
throw typeError0("msg.in.not.object");
}
return hasObjectElem((Scriptable)b, a, cx);
} | [
"public",
"static",
"boolean",
"in",
"(",
"Object",
"a",
",",
"Object",
"b",
",",
"Context",
"cx",
")",
"{",
"if",
"(",
"!",
"(",
"b",
"instanceof",
"Scriptable",
")",
")",
"{",
"throw",
"typeError0",
"(",
"\"msg.in.not.object\"",
")",
";",
"}",
"retur... | The in operator.
This is a new JS 1.3 language feature. The in operator mirrors
the operation of the for .. in construct, and tests whether the
rhs has the property given by the lhs. It is different from the
for .. in construct in that:
<BR> - it doesn't perform ToObject on the right hand side
<BR> - it returns true... | [
"The",
"in",
"operator",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ScriptRuntime.java#L3447-L3454 |
21,515 | mozilla/rhino | src/org/mozilla/javascript/ScriptRuntime.java | ScriptRuntime.escapeAttributeValue | public static String escapeAttributeValue(Object value, Context cx)
{
XMLLib xmlLib = currentXMLLib(cx);
return xmlLib.escapeAttributeValue(value);
} | java | public static String escapeAttributeValue(Object value, Context cx)
{
XMLLib xmlLib = currentXMLLib(cx);
return xmlLib.escapeAttributeValue(value);
} | [
"public",
"static",
"String",
"escapeAttributeValue",
"(",
"Object",
"value",
",",
"Context",
"cx",
")",
"{",
"XMLLib",
"xmlLib",
"=",
"currentXMLLib",
"(",
"cx",
")",
";",
"return",
"xmlLib",
".",
"escapeAttributeValue",
"(",
"value",
")",
";",
"}"
] | Escapes the reserved characters in a value of an attribute
@param value Unescaped text
@return The escaped text | [
"Escapes",
"the",
"reserved",
"characters",
"in",
"a",
"value",
"of",
"an",
"attribute"
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ScriptRuntime.java#L4429-L4433 |
21,516 | mozilla/rhino | src/org/mozilla/javascript/ScriptRuntime.java | ScriptRuntime.isSymbol | static boolean isSymbol(Object obj) {
return (((obj instanceof NativeSymbol) &&
((NativeSymbol)obj).isSymbol())) || (obj instanceof SymbolKey);
} | java | static boolean isSymbol(Object obj) {
return (((obj instanceof NativeSymbol) &&
((NativeSymbol)obj).isSymbol())) || (obj instanceof SymbolKey);
} | [
"static",
"boolean",
"isSymbol",
"(",
"Object",
"obj",
")",
"{",
"return",
"(",
"(",
"(",
"obj",
"instanceof",
"NativeSymbol",
")",
"&&",
"(",
"(",
"NativeSymbol",
")",
"obj",
")",
".",
"isSymbol",
"(",
")",
")",
")",
"||",
"(",
"obj",
"instanceof",
... | Not all "NativeSymbol" instances are actually symbols. So account for that here rather than just
by using an "instanceof" check. | [
"Not",
"all",
"NativeSymbol",
"instances",
"are",
"actually",
"symbols",
".",
"So",
"account",
"for",
"that",
"here",
"rather",
"than",
"just",
"by",
"using",
"an",
"instanceof",
"check",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ScriptRuntime.java#L4541-L4544 |
21,517 | mozilla/rhino | src/org/mozilla/javascript/MemberBox.java | MemberBox.writeMember | private static void writeMember(ObjectOutputStream out, Executable member)
throws IOException
{
if (member == null) {
out.writeBoolean(false);
return;
}
out.writeBoolean(true);
if (!(member instanceof Method || member instanceof Constructor))
... | java | private static void writeMember(ObjectOutputStream out, Executable member)
throws IOException
{
if (member == null) {
out.writeBoolean(false);
return;
}
out.writeBoolean(true);
if (!(member instanceof Method || member instanceof Constructor))
... | [
"private",
"static",
"void",
"writeMember",
"(",
"ObjectOutputStream",
"out",
",",
"Executable",
"member",
")",
"throws",
"IOException",
"{",
"if",
"(",
"member",
"==",
"null",
")",
"{",
"out",
".",
"writeBoolean",
"(",
"false",
")",
";",
"return",
";",
"}... | Writes a Constructor or Method object.
Methods and Constructors are not serializable, so we must serialize
information about the class, the name, and the parameters and
recreate upon deserialization. | [
"Writes",
"a",
"Constructor",
"or",
"Method",
"object",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/MemberBox.java#L227-L241 |
21,518 | mozilla/rhino | src/org/mozilla/javascript/MemberBox.java | MemberBox.readMember | private static Executable readMember(ObjectInputStream in)
throws IOException, ClassNotFoundException
{
if (!in.readBoolean())
return null;
boolean isMethod = in.readBoolean();
String name = (String) in.readObject();
Class<?> declaring = (Class<?>) in.readObject()... | java | private static Executable readMember(ObjectInputStream in)
throws IOException, ClassNotFoundException
{
if (!in.readBoolean())
return null;
boolean isMethod = in.readBoolean();
String name = (String) in.readObject();
Class<?> declaring = (Class<?>) in.readObject()... | [
"private",
"static",
"Executable",
"readMember",
"(",
"ObjectInputStream",
"in",
")",
"throws",
"IOException",
",",
"ClassNotFoundException",
"{",
"if",
"(",
"!",
"in",
".",
"readBoolean",
"(",
")",
")",
"return",
"null",
";",
"boolean",
"isMethod",
"=",
"in",... | Reads a Method or a Constructor from the stream. | [
"Reads",
"a",
"Method",
"or",
"a",
"Constructor",
"from",
"the",
"stream",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/MemberBox.java#L246-L263 |
21,519 | mozilla/rhino | src/org/mozilla/javascript/MemberBox.java | MemberBox.writeParameters | private static void writeParameters(ObjectOutputStream out, Class<?>[] parms)
throws IOException
{
out.writeShort(parms.length);
outer:
for (int i=0; i < parms.length; i++) {
Class<?> parm = parms[i];
boolean primitive = parm.isPrimitive();
out.writeBo... | java | private static void writeParameters(ObjectOutputStream out, Class<?>[] parms)
throws IOException
{
out.writeShort(parms.length);
outer:
for (int i=0; i < parms.length; i++) {
Class<?> parm = parms[i];
boolean primitive = parm.isPrimitive();
out.writeBo... | [
"private",
"static",
"void",
"writeParameters",
"(",
"ObjectOutputStream",
"out",
",",
"Class",
"<",
"?",
">",
"[",
"]",
"parms",
")",
"throws",
"IOException",
"{",
"out",
".",
"writeShort",
"(",
"parms",
".",
"length",
")",
";",
"outer",
":",
"for",
"("... | Writes an array of parameter types to the stream.
Requires special handling because primitive types cannot be
found upon deserialization by the default Java implementation. | [
"Writes",
"an",
"array",
"of",
"parameter",
"types",
"to",
"the",
"stream",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/MemberBox.java#L283-L305 |
21,520 | mozilla/rhino | src/org/mozilla/javascript/MemberBox.java | MemberBox.readParameters | private static Class<?>[] readParameters(ObjectInputStream in)
throws IOException, ClassNotFoundException
{
Class<?>[] result = new Class[in.readShort()];
for (int i=0; i < result.length; i++) {
if (!in.readBoolean()) {
result[i] = (Class<?>) in.readObject();
... | java | private static Class<?>[] readParameters(ObjectInputStream in)
throws IOException, ClassNotFoundException
{
Class<?>[] result = new Class[in.readShort()];
for (int i=0; i < result.length; i++) {
if (!in.readBoolean()) {
result[i] = (Class<?>) in.readObject();
... | [
"private",
"static",
"Class",
"<",
"?",
">",
"[",
"]",
"readParameters",
"(",
"ObjectInputStream",
"in",
")",
"throws",
"IOException",
",",
"ClassNotFoundException",
"{",
"Class",
"<",
"?",
">",
"[",
"]",
"result",
"=",
"new",
"Class",
"[",
"in",
".",
"r... | Reads an array of parameter types from the stream. | [
"Reads",
"an",
"array",
"of",
"parameter",
"types",
"from",
"the",
"stream",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/MemberBox.java#L310-L322 |
21,521 | mozilla/rhino | toolsrc/org/mozilla/javascript/tools/debugger/Dim.java | Dim.attachTo | public void attachTo(ContextFactory factory) {
detach();
this.contextFactory = factory;
this.listener = new DimIProxy(this, IPROXY_LISTEN);
factory.addListener(this.listener);
} | java | public void attachTo(ContextFactory factory) {
detach();
this.contextFactory = factory;
this.listener = new DimIProxy(this, IPROXY_LISTEN);
factory.addListener(this.listener);
} | [
"public",
"void",
"attachTo",
"(",
"ContextFactory",
"factory",
")",
"{",
"detach",
"(",
")",
";",
"this",
".",
"contextFactory",
"=",
"factory",
";",
"this",
".",
"listener",
"=",
"new",
"DimIProxy",
"(",
"this",
",",
"IPROXY_LISTEN",
")",
";",
"factory",... | Attaches the debugger to the given ContextFactory. | [
"Attaches",
"the",
"debugger",
"to",
"the",
"given",
"ContextFactory",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/toolsrc/org/mozilla/javascript/tools/debugger/Dim.java#L232-L237 |
21,522 | mozilla/rhino | toolsrc/org/mozilla/javascript/tools/debugger/Dim.java | Dim.detach | public void detach() {
if (listener != null) {
contextFactory.removeListener(listener);
contextFactory = null;
listener = null;
}
} | java | public void detach() {
if (listener != null) {
contextFactory.removeListener(listener);
contextFactory = null;
listener = null;
}
} | [
"public",
"void",
"detach",
"(",
")",
"{",
"if",
"(",
"listener",
"!=",
"null",
")",
"{",
"contextFactory",
".",
"removeListener",
"(",
"listener",
")",
";",
"contextFactory",
"=",
"null",
";",
"listener",
"=",
"null",
";",
"}",
"}"
] | Detaches the debugger from the current ContextFactory. | [
"Detaches",
"the",
"debugger",
"from",
"the",
"current",
"ContextFactory",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/toolsrc/org/mozilla/javascript/tools/debugger/Dim.java#L242-L248 |
21,523 | mozilla/rhino | toolsrc/org/mozilla/javascript/tools/debugger/Dim.java | Dim.getFunctionSource | private FunctionSource getFunctionSource(DebuggableScript fnOrScript) {
FunctionSource fsource = functionSource(fnOrScript);
if (fsource == null) {
String url = getNormalizedUrl(fnOrScript);
SourceInfo si = sourceInfo(url);
if (si == null) {
if (!fnOrS... | java | private FunctionSource getFunctionSource(DebuggableScript fnOrScript) {
FunctionSource fsource = functionSource(fnOrScript);
if (fsource == null) {
String url = getNormalizedUrl(fnOrScript);
SourceInfo si = sourceInfo(url);
if (si == null) {
if (!fnOrS... | [
"private",
"FunctionSource",
"getFunctionSource",
"(",
"DebuggableScript",
"fnOrScript",
")",
"{",
"FunctionSource",
"fsource",
"=",
"functionSource",
"(",
"fnOrScript",
")",
";",
"if",
"(",
"fsource",
"==",
"null",
")",
"{",
"String",
"url",
"=",
"getNormalizedUr... | Returns the FunctionSource object for the given script or function. | [
"Returns",
"the",
"FunctionSource",
"object",
"for",
"the",
"given",
"script",
"or",
"function",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/toolsrc/org/mozilla/javascript/tools/debugger/Dim.java#L260-L285 |
21,524 | mozilla/rhino | toolsrc/org/mozilla/javascript/tools/debugger/Dim.java | Dim.loadSource | private String loadSource(String sourceUrl) {
String source = null;
int hash = sourceUrl.indexOf('#');
if (hash >= 0) {
sourceUrl = sourceUrl.substring(0, hash);
}
try {
InputStream is;
openStream:
{
if (sourceUrl.inde... | java | private String loadSource(String sourceUrl) {
String source = null;
int hash = sourceUrl.indexOf('#');
if (hash >= 0) {
sourceUrl = sourceUrl.substring(0, hash);
}
try {
InputStream is;
openStream:
{
if (sourceUrl.inde... | [
"private",
"String",
"loadSource",
"(",
"String",
"sourceUrl",
")",
"{",
"String",
"source",
"=",
"null",
";",
"int",
"hash",
"=",
"sourceUrl",
".",
"indexOf",
"(",
"'",
"'",
")",
";",
"if",
"(",
"hash",
">=",
"0",
")",
"{",
"sourceUrl",
"=",
"source... | Loads the script at the given URL. | [
"Loads",
"the",
"script",
"at",
"the",
"given",
"URL",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/toolsrc/org/mozilla/javascript/tools/debugger/Dim.java#L290-L343 |
21,525 | mozilla/rhino | toolsrc/org/mozilla/javascript/tools/debugger/Dim.java | Dim.registerTopScript | private void registerTopScript(DebuggableScript topScript, String source) {
if (!topScript.isTopLevel()) {
throw new IllegalArgumentException();
}
String url = getNormalizedUrl(topScript);
DebuggableScript[] functions = getAllFunctions(topScript);
if (sourceProvider !... | java | private void registerTopScript(DebuggableScript topScript, String source) {
if (!topScript.isTopLevel()) {
throw new IllegalArgumentException();
}
String url = getNormalizedUrl(topScript);
DebuggableScript[] functions = getAllFunctions(topScript);
if (sourceProvider !... | [
"private",
"void",
"registerTopScript",
"(",
"DebuggableScript",
"topScript",
",",
"String",
"source",
")",
"{",
"if",
"(",
"!",
"topScript",
".",
"isTopLevel",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
")",
";",
"}",
"String",
"ur... | Registers the given script as a top-level script in the debugger. | [
"Registers",
"the",
"given",
"script",
"as",
"a",
"top",
"-",
"level",
"script",
"in",
"the",
"debugger",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/toolsrc/org/mozilla/javascript/tools/debugger/Dim.java#L348-L386 |
21,526 | mozilla/rhino | toolsrc/org/mozilla/javascript/tools/debugger/Dim.java | Dim.getNormalizedUrl | private String getNormalizedUrl(DebuggableScript fnOrScript) {
String url = fnOrScript.getSourceName();
if (url == null) { url = "<stdin>"; }
else {
// Not to produce window for eval from different lines,
// strip line numbers, i.e. replace all #[0-9]+\(eval\) by
... | java | private String getNormalizedUrl(DebuggableScript fnOrScript) {
String url = fnOrScript.getSourceName();
if (url == null) { url = "<stdin>"; }
else {
// Not to produce window for eval from different lines,
// strip line numbers, i.e. replace all #[0-9]+\(eval\) by
... | [
"private",
"String",
"getNormalizedUrl",
"(",
"DebuggableScript",
"fnOrScript",
")",
"{",
"String",
"url",
"=",
"fnOrScript",
".",
"getSourceName",
"(",
")",
";",
"if",
"(",
"url",
"==",
"null",
")",
"{",
"url",
"=",
"\"<stdin>\"",
";",
"}",
"else",
"{",
... | Returns the source URL for the given script or function. | [
"Returns",
"the",
"source",
"URL",
"for",
"the",
"given",
"script",
"or",
"function",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/toolsrc/org/mozilla/javascript/tools/debugger/Dim.java#L421-L471 |
21,527 | mozilla/rhino | toolsrc/org/mozilla/javascript/tools/debugger/Dim.java | Dim.getAllFunctions | private static DebuggableScript[] getAllFunctions
(DebuggableScript function) {
ObjArray functions = new ObjArray();
collectFunctions_r(function, functions);
DebuggableScript[] result = new DebuggableScript[functions.size()];
functions.toArray(result);
return result;
... | java | private static DebuggableScript[] getAllFunctions
(DebuggableScript function) {
ObjArray functions = new ObjArray();
collectFunctions_r(function, functions);
DebuggableScript[] result = new DebuggableScript[functions.size()];
functions.toArray(result);
return result;
... | [
"private",
"static",
"DebuggableScript",
"[",
"]",
"getAllFunctions",
"(",
"DebuggableScript",
"function",
")",
"{",
"ObjArray",
"functions",
"=",
"new",
"ObjArray",
"(",
")",
";",
"collectFunctions_r",
"(",
"function",
",",
"functions",
")",
";",
"DebuggableScrip... | Returns an array of all functions in the given script. | [
"Returns",
"an",
"array",
"of",
"all",
"functions",
"in",
"the",
"given",
"script",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/toolsrc/org/mozilla/javascript/tools/debugger/Dim.java#L476-L483 |
21,528 | mozilla/rhino | toolsrc/org/mozilla/javascript/tools/debugger/Dim.java | Dim.handleBreakpointHit | private void handleBreakpointHit(StackFrame frame, Context cx) {
breakFlag = false;
interrupted(cx, frame, null);
} | java | private void handleBreakpointHit(StackFrame frame, Context cx) {
breakFlag = false;
interrupted(cx, frame, null);
} | [
"private",
"void",
"handleBreakpointHit",
"(",
"StackFrame",
"frame",
",",
"Context",
"cx",
")",
"{",
"breakFlag",
"=",
"false",
";",
"interrupted",
"(",
"cx",
",",
"frame",
",",
"null",
")",
";",
"}"
] | Called when a breakpoint has been hit. | [
"Called",
"when",
"a",
"breakpoint",
"has",
"been",
"hit",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/toolsrc/org/mozilla/javascript/tools/debugger/Dim.java#L508-L511 |
21,529 | mozilla/rhino | toolsrc/org/mozilla/javascript/tools/debugger/Dim.java | Dim.handleExceptionThrown | private void handleExceptionThrown(Context cx, Throwable ex,
StackFrame frame) {
if (breakOnExceptions) {
ContextData cd = frame.contextData();
if (cd.lastProcessedException != ex) {
interrupted(cx, frame, ex);
cd.l... | java | private void handleExceptionThrown(Context cx, Throwable ex,
StackFrame frame) {
if (breakOnExceptions) {
ContextData cd = frame.contextData();
if (cd.lastProcessedException != ex) {
interrupted(cx, frame, ex);
cd.l... | [
"private",
"void",
"handleExceptionThrown",
"(",
"Context",
"cx",
",",
"Throwable",
"ex",
",",
"StackFrame",
"frame",
")",
"{",
"if",
"(",
"breakOnExceptions",
")",
"{",
"ContextData",
"cd",
"=",
"frame",
".",
"contextData",
"(",
")",
";",
"if",
"(",
"cd",... | Called when a script exception has been thrown. | [
"Called",
"when",
"a",
"script",
"exception",
"has",
"been",
"thrown",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/toolsrc/org/mozilla/javascript/tools/debugger/Dim.java#L516-L525 |
21,530 | mozilla/rhino | toolsrc/org/mozilla/javascript/tools/debugger/Dim.java | Dim.compileScript | public void compileScript(String url, String text) {
DimIProxy action = new DimIProxy(this, IPROXY_COMPILE_SCRIPT);
action.url = url;
action.text = text;
action.withContext();
} | java | public void compileScript(String url, String text) {
DimIProxy action = new DimIProxy(this, IPROXY_COMPILE_SCRIPT);
action.url = url;
action.text = text;
action.withContext();
} | [
"public",
"void",
"compileScript",
"(",
"String",
"url",
",",
"String",
"text",
")",
"{",
"DimIProxy",
"action",
"=",
"new",
"DimIProxy",
"(",
"this",
",",
"IPROXY_COMPILE_SCRIPT",
")",
";",
"action",
".",
"url",
"=",
"url",
";",
"action",
".",
"text",
"... | Compiles the given script. | [
"Compiles",
"the",
"given",
"script",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/toolsrc/org/mozilla/javascript/tools/debugger/Dim.java#L594-L599 |
21,531 | mozilla/rhino | toolsrc/org/mozilla/javascript/tools/debugger/Dim.java | Dim.objectToString | public String objectToString(Object object) {
DimIProxy action = new DimIProxy(this, IPROXY_OBJECT_TO_STRING);
action.object = object;
action.withContext();
return action.stringResult;
} | java | public String objectToString(Object object) {
DimIProxy action = new DimIProxy(this, IPROXY_OBJECT_TO_STRING);
action.object = object;
action.withContext();
return action.stringResult;
} | [
"public",
"String",
"objectToString",
"(",
"Object",
"object",
")",
"{",
"DimIProxy",
"action",
"=",
"new",
"DimIProxy",
"(",
"this",
",",
"IPROXY_OBJECT_TO_STRING",
")",
";",
"action",
".",
"object",
"=",
"object",
";",
"action",
".",
"withContext",
"(",
")... | Converts the given script object to a string. | [
"Converts",
"the",
"given",
"script",
"object",
"to",
"a",
"string",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/toolsrc/org/mozilla/javascript/tools/debugger/Dim.java#L614-L619 |
21,532 | mozilla/rhino | toolsrc/org/mozilla/javascript/tools/debugger/Dim.java | Dim.stringIsCompilableUnit | public boolean stringIsCompilableUnit(String str) {
DimIProxy action = new DimIProxy(this, IPROXY_STRING_IS_COMPILABLE);
action.text = str;
action.withContext();
return action.booleanResult;
} | java | public boolean stringIsCompilableUnit(String str) {
DimIProxy action = new DimIProxy(this, IPROXY_STRING_IS_COMPILABLE);
action.text = str;
action.withContext();
return action.booleanResult;
} | [
"public",
"boolean",
"stringIsCompilableUnit",
"(",
"String",
"str",
")",
"{",
"DimIProxy",
"action",
"=",
"new",
"DimIProxy",
"(",
"this",
",",
"IPROXY_STRING_IS_COMPILABLE",
")",
";",
"action",
".",
"text",
"=",
"str",
";",
"action",
".",
"withContext",
"(",... | Returns whether the given string is syntactically valid script. | [
"Returns",
"whether",
"the",
"given",
"string",
"is",
"syntactically",
"valid",
"script",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/toolsrc/org/mozilla/javascript/tools/debugger/Dim.java#L624-L629 |
21,533 | mozilla/rhino | toolsrc/org/mozilla/javascript/tools/debugger/Dim.java | Dim.do_eval | private static String do_eval(Context cx, StackFrame frame, String expr) {
String resultString;
Debugger saved_debugger = cx.getDebugger();
Object saved_data = cx.getDebuggerContextData();
int saved_level = cx.getOptimizationLevel();
cx.setDebugger(null, null);
cx.setOpt... | java | private static String do_eval(Context cx, StackFrame frame, String expr) {
String resultString;
Debugger saved_debugger = cx.getDebugger();
Object saved_data = cx.getDebuggerContextData();
int saved_level = cx.getOptimizationLevel();
cx.setDebugger(null, null);
cx.setOpt... | [
"private",
"static",
"String",
"do_eval",
"(",
"Context",
"cx",
",",
"StackFrame",
"frame",
",",
"String",
"expr",
")",
"{",
"String",
"resultString",
";",
"Debugger",
"saved_debugger",
"=",
"cx",
".",
"getDebugger",
"(",
")",
";",
"Object",
"saved_data",
"=... | Evaluates script in the given stack frame. | [
"Evaluates",
"script",
"in",
"the",
"given",
"stack",
"frame",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/toolsrc/org/mozilla/javascript/tools/debugger/Dim.java#L866-L895 |
21,534 | mozilla/rhino | src/org/mozilla/javascript/ast/Symbol.java | Symbol.setDeclType | public void setDeclType(int declType) {
if (!(declType == Token.FUNCTION
|| declType == Token.LP
|| declType == Token.VAR
|| declType == Token.LET
|| declType == Token.CONST))
throw new IllegalArgumentException("Invalid declType: " + declType);... | java | public void setDeclType(int declType) {
if (!(declType == Token.FUNCTION
|| declType == Token.LP
|| declType == Token.VAR
|| declType == Token.LET
|| declType == Token.CONST))
throw new IllegalArgumentException("Invalid declType: " + declType);... | [
"public",
"void",
"setDeclType",
"(",
"int",
"declType",
")",
"{",
"if",
"(",
"!",
"(",
"declType",
"==",
"Token",
".",
"FUNCTION",
"||",
"declType",
"==",
"Token",
".",
"LP",
"||",
"declType",
"==",
"Token",
".",
"VAR",
"||",
"declType",
"==",
"Token"... | Sets symbol declaration type | [
"Sets",
"symbol",
"declaration",
"type"
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ast/Symbol.java#L48-L56 |
21,535 | mozilla/rhino | src/org/mozilla/javascript/ClassCache.java | ClassCache.associate | public boolean associate(ScriptableObject topScope)
{
if (topScope.getParentScope() != null) {
// Can only associate cache with top level scope
throw new IllegalArgumentException();
}
if (this == topScope.associateValue(AKEY, this)) {
associatedScope = top... | java | public boolean associate(ScriptableObject topScope)
{
if (topScope.getParentScope() != null) {
// Can only associate cache with top level scope
throw new IllegalArgumentException();
}
if (this == topScope.associateValue(AKEY, this)) {
associatedScope = top... | [
"public",
"boolean",
"associate",
"(",
"ScriptableObject",
"topScope",
")",
"{",
"if",
"(",
"topScope",
".",
"getParentScope",
"(",
")",
"!=",
"null",
")",
"{",
"// Can only associate cache with top level scope",
"throw",
"new",
"IllegalArgumentException",
"(",
")",
... | Associate ClassCache object with the given top-level scope.
The ClassCache object can only be associated with the given scope once.
@param topScope scope to associate this ClassCache object with.
@return true if no previous ClassCache objects were embedded into
the scope and this ClassCache were successfully associate... | [
"Associate",
"ClassCache",
"object",
"with",
"the",
"given",
"top",
"-",
"level",
"scope",
".",
"The",
"ClassCache",
"object",
"can",
"only",
"be",
"associated",
"with",
"the",
"given",
"scope",
"once",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ClassCache.java#L67-L78 |
21,536 | mozilla/rhino | examples/Foo.java | Foo.varargs | @JSFunction
public static Object varargs(Context cx, Scriptable thisObj,
Object[] args, Function funObj)
{
StringBuilder buf = new StringBuilder();
buf.append("this = ");
buf.append(Context.toString(thisObj));
buf.append("; args = [");
... | java | @JSFunction
public static Object varargs(Context cx, Scriptable thisObj,
Object[] args, Function funObj)
{
StringBuilder buf = new StringBuilder();
buf.append("this = ");
buf.append(Context.toString(thisObj));
buf.append("; args = [");
... | [
"@",
"JSFunction",
"public",
"static",
"Object",
"varargs",
"(",
"Context",
"cx",
",",
"Scriptable",
"thisObj",
",",
"Object",
"[",
"]",
"args",
",",
"Function",
"funObj",
")",
"{",
"StringBuilder",
"buf",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"buf",... | An example of a variable-arguments method.
All variable arguments methods must have the same number and
types of parameters, and must be static. <p>
@param cx the Context of the current thread
@param thisObj the JavaScript 'this' value.
@param args the array of arguments for this call
@param funObj the function object... | [
"An",
"example",
"of",
"a",
"variable",
"-",
"arguments",
"method",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/examples/Foo.java#L126-L141 |
21,537 | mozilla/rhino | src/org/mozilla/javascript/ES6Iterator.java | ES6Iterator.makeIteratorResult | private Scriptable makeIteratorResult(Context cx, Scriptable scope, boolean done, Object value) {
Scriptable iteratorResult = cx.newObject(scope);
ScriptableObject.putProperty(iteratorResult, VALUE_PROPERTY, value);
ScriptableObject.putProperty(iteratorResult, DONE_PROPERTY, done);
retur... | java | private Scriptable makeIteratorResult(Context cx, Scriptable scope, boolean done, Object value) {
Scriptable iteratorResult = cx.newObject(scope);
ScriptableObject.putProperty(iteratorResult, VALUE_PROPERTY, value);
ScriptableObject.putProperty(iteratorResult, DONE_PROPERTY, done);
retur... | [
"private",
"Scriptable",
"makeIteratorResult",
"(",
"Context",
"cx",
",",
"Scriptable",
"scope",
",",
"boolean",
"done",
",",
"Object",
"value",
")",
"{",
"Scriptable",
"iteratorResult",
"=",
"cx",
".",
"newObject",
"(",
"scope",
")",
";",
"ScriptableObject",
... | 25.1.1.3 The IteratorResult Interface | [
"25",
".",
"1",
".",
"1",
".",
"3",
"The",
"IteratorResult",
"Interface"
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ES6Iterator.java#L126-L131 |
21,538 | mozilla/rhino | src/org/mozilla/javascript/v8dtoa/DiyFp.java | DiyFp.subtract | void subtract(DiyFp other) {
assert (e == other.e);
assert uint64_gte(f, other.f);
f -= other.f;
} | java | void subtract(DiyFp other) {
assert (e == other.e);
assert uint64_gte(f, other.f);
f -= other.f;
} | [
"void",
"subtract",
"(",
"DiyFp",
"other",
")",
"{",
"assert",
"(",
"e",
"==",
"other",
".",
"e",
")",
";",
"assert",
"uint64_gte",
"(",
"f",
",",
"other",
".",
"f",
")",
";",
"f",
"-=",
"other",
".",
"f",
";",
"}"
] | The result will not be normalized. | [
"The",
"result",
"will",
"not",
"be",
"normalized",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/v8dtoa/DiyFp.java#L66-L70 |
21,539 | mozilla/rhino | src/org/mozilla/javascript/v8dtoa/DiyFp.java | DiyFp.minus | static DiyFp minus(DiyFp a, DiyFp b) {
DiyFp result = new DiyFp(a.f, a.e);
result.subtract(b);
return result;
} | java | static DiyFp minus(DiyFp a, DiyFp b) {
DiyFp result = new DiyFp(a.f, a.e);
result.subtract(b);
return result;
} | [
"static",
"DiyFp",
"minus",
"(",
"DiyFp",
"a",
",",
"DiyFp",
"b",
")",
"{",
"DiyFp",
"result",
"=",
"new",
"DiyFp",
"(",
"a",
".",
"f",
",",
"a",
".",
"e",
")",
";",
"result",
".",
"subtract",
"(",
"b",
")",
";",
"return",
"result",
";",
"}"
] | than other. The result will not be normalized. | [
"than",
"other",
".",
"The",
"result",
"will",
"not",
"be",
"normalized",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/v8dtoa/DiyFp.java#L75-L79 |
21,540 | mozilla/rhino | src/org/mozilla/javascript/ast/SwitchStatement.java | SwitchStatement.setCases | public void setCases(List<SwitchCase> cases) {
if (cases == null) {
this.cases = null;
} else {
if (this.cases != null)
this.cases.clear();
for (SwitchCase sc : cases)
addCase(sc);
}
} | java | public void setCases(List<SwitchCase> cases) {
if (cases == null) {
this.cases = null;
} else {
if (this.cases != null)
this.cases.clear();
for (SwitchCase sc : cases)
addCase(sc);
}
} | [
"public",
"void",
"setCases",
"(",
"List",
"<",
"SwitchCase",
">",
"cases",
")",
"{",
"if",
"(",
"cases",
"==",
"null",
")",
"{",
"this",
".",
"cases",
"=",
"null",
";",
"}",
"else",
"{",
"if",
"(",
"this",
".",
"cases",
"!=",
"null",
")",
"this"... | Sets case statement list, and sets the parent of each child
case to this node.
@param cases list, which may be {@code null} to remove all the cases | [
"Sets",
"case",
"statement",
"list",
"and",
"sets",
"the",
"parent",
"of",
"each",
"child",
"case",
"to",
"this",
"node",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ast/SwitchStatement.java#L90-L99 |
21,541 | mozilla/rhino | src/org/mozilla/javascript/ast/SwitchStatement.java | SwitchStatement.addCase | public void addCase(SwitchCase switchCase) {
assertNotNull(switchCase);
if (cases == null) {
cases = new ArrayList<SwitchCase>();
}
cases.add(switchCase);
switchCase.setParent(this);
} | java | public void addCase(SwitchCase switchCase) {
assertNotNull(switchCase);
if (cases == null) {
cases = new ArrayList<SwitchCase>();
}
cases.add(switchCase);
switchCase.setParent(this);
} | [
"public",
"void",
"addCase",
"(",
"SwitchCase",
"switchCase",
")",
"{",
"assertNotNull",
"(",
"switchCase",
")",
";",
"if",
"(",
"cases",
"==",
"null",
")",
"{",
"cases",
"=",
"new",
"ArrayList",
"<",
"SwitchCase",
">",
"(",
")",
";",
"}",
"cases",
"."... | Adds a switch case statement to the end of the list.
@throws IllegalArgumentException} if switchCase is {@code null} | [
"Adds",
"a",
"switch",
"case",
"statement",
"to",
"the",
"end",
"of",
"the",
"list",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ast/SwitchStatement.java#L105-L112 |
21,542 | mozilla/rhino | src/org/mozilla/javascript/ast/SwitchStatement.java | SwitchStatement.visit | @Override
public void visit(NodeVisitor v) {
if (v.visit(this)) {
expression.visit(v);
for (SwitchCase sc: getCases()) {
sc.visit(v);
}
}
} | java | @Override
public void visit(NodeVisitor v) {
if (v.visit(this)) {
expression.visit(v);
for (SwitchCase sc: getCases()) {
sc.visit(v);
}
}
} | [
"@",
"Override",
"public",
"void",
"visit",
"(",
"NodeVisitor",
"v",
")",
"{",
"if",
"(",
"v",
".",
"visit",
"(",
"this",
")",
")",
"{",
"expression",
".",
"visit",
"(",
"v",
")",
";",
"for",
"(",
"SwitchCase",
"sc",
":",
"getCases",
"(",
")",
")... | Visits this node, then the switch-expression, then the cases
in lexical order. | [
"Visits",
"this",
"node",
"then",
"the",
"switch",
"-",
"expression",
"then",
"the",
"cases",
"in",
"lexical",
"order",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ast/SwitchStatement.java#L172-L180 |
21,543 | mozilla/rhino | src/org/mozilla/javascript/IRFactory.java | IRFactory.transformTree | public ScriptNode transformTree(AstRoot root) {
currentScriptOrFn = root;
this.inUseStrictDirective = root.isInStrictMode();
int sourceStartOffset = decompiler.getCurrentOffset();
if (Token.printTrees) {
System.out.println("IRFactory.transformTree");
System.out.p... | java | public ScriptNode transformTree(AstRoot root) {
currentScriptOrFn = root;
this.inUseStrictDirective = root.isInStrictMode();
int sourceStartOffset = decompiler.getCurrentOffset();
if (Token.printTrees) {
System.out.println("IRFactory.transformTree");
System.out.p... | [
"public",
"ScriptNode",
"transformTree",
"(",
"AstRoot",
"root",
")",
"{",
"currentScriptOrFn",
"=",
"root",
";",
"this",
".",
"inUseStrictDirective",
"=",
"root",
".",
"isInStrictMode",
"(",
")",
";",
"int",
"sourceStartOffset",
"=",
"decompiler",
".",
"getCurr... | Transforms the tree into a lower-level IR suitable for codegen.
Optionally generates the encoded source. | [
"Transforms",
"the",
"tree",
"into",
"a",
"lower",
"-",
"level",
"IR",
"suitable",
"for",
"codegen",
".",
"Optionally",
"generates",
"the",
"encoded",
"source",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/IRFactory.java#L108-L129 |
21,544 | mozilla/rhino | src/org/mozilla/javascript/IRFactory.java | IRFactory.transformXmlRef | private Node transformXmlRef(XmlRef node) {
int memberTypeFlags = node.isAttributeAccess()
? Node.ATTRIBUTE_FLAG : 0;
return transformXmlRef(null, node, memberTypeFlags);
} | java | private Node transformXmlRef(XmlRef node) {
int memberTypeFlags = node.isAttributeAccess()
? Node.ATTRIBUTE_FLAG : 0;
return transformXmlRef(null, node, memberTypeFlags);
} | [
"private",
"Node",
"transformXmlRef",
"(",
"XmlRef",
"node",
")",
"{",
"int",
"memberTypeFlags",
"=",
"node",
".",
"isAttributeAccess",
"(",
")",
"?",
"Node",
".",
"ATTRIBUTE_FLAG",
":",
"0",
";",
"return",
"transformXmlRef",
"(",
"null",
",",
"node",
",",
... | We get here if we weren't a child of a . or .. infix node | [
"We",
"get",
"here",
"if",
"we",
"weren",
"t",
"a",
"child",
"of",
"a",
".",
"or",
"..",
"infix",
"node"
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/IRFactory.java#L1357-L1361 |
21,545 | mozilla/rhino | src/org/mozilla/javascript/IRFactory.java | IRFactory.addSwitchCase | private void addSwitchCase(Node switchBlock, Node caseExpression,
Node statements)
{
if (switchBlock.getType() != Token.BLOCK) throw Kit.codeBug();
Jump switchNode = (Jump)switchBlock.getFirstChild();
if (switchNode.getType() != Token.SWITCH) throw Kit.codeBug(... | java | private void addSwitchCase(Node switchBlock, Node caseExpression,
Node statements)
{
if (switchBlock.getType() != Token.BLOCK) throw Kit.codeBug();
Jump switchNode = (Jump)switchBlock.getFirstChild();
if (switchNode.getType() != Token.SWITCH) throw Kit.codeBug(... | [
"private",
"void",
"addSwitchCase",
"(",
"Node",
"switchBlock",
",",
"Node",
"caseExpression",
",",
"Node",
"statements",
")",
"{",
"if",
"(",
"switchBlock",
".",
"getType",
"(",
")",
"!=",
"Token",
".",
"BLOCK",
")",
"throw",
"Kit",
".",
"codeBug",
"(",
... | If caseExpression argument is null it indicates a default label. | [
"If",
"caseExpression",
"argument",
"is",
"null",
"it",
"indicates",
"a",
"default",
"label",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/IRFactory.java#L1395-L1412 |
21,546 | mozilla/rhino | src/org/mozilla/javascript/IRFactory.java | IRFactory.createLoopNode | private Scope createLoopNode(Node loopLabel, int lineno) {
Scope result = createScopeNode(Token.LOOP, lineno);
if (loopLabel != null) {
((Jump)loopLabel).setLoop(result);
}
return result;
} | java | private Scope createLoopNode(Node loopLabel, int lineno) {
Scope result = createScopeNode(Token.LOOP, lineno);
if (loopLabel != null) {
((Jump)loopLabel).setLoop(result);
}
return result;
} | [
"private",
"Scope",
"createLoopNode",
"(",
"Node",
"loopLabel",
",",
"int",
"lineno",
")",
"{",
"Scope",
"result",
"=",
"createScopeNode",
"(",
"Token",
".",
"LOOP",
",",
"lineno",
")",
";",
"if",
"(",
"loopLabel",
"!=",
"null",
")",
"{",
"(",
"(",
"Ju... | Create loop node. The code generator will later call
createWhile|createDoWhile|createFor|createForIn
to finish loop generation. | [
"Create",
"loop",
"node",
".",
"The",
"code",
"generator",
"will",
"later",
"call",
"createWhile|createDoWhile|createFor|createForIn",
"to",
"finish",
"loop",
"generation",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/IRFactory.java#L1508-L1514 |
21,547 | mozilla/rhino | src/org/mozilla/javascript/IRFactory.java | IRFactory.createForIn | private Node createForIn(int declType, Node loop, Node lhs,
Node obj, Node body, boolean isForEach, boolean isForOf)
{
int destructuring = -1;
int destructuringLen = 0;
Node lvalue;
int type = lhs.getType();
if (type == Token.VAR || type == Token.... | java | private Node createForIn(int declType, Node loop, Node lhs,
Node obj, Node body, boolean isForEach, boolean isForOf)
{
int destructuring = -1;
int destructuringLen = 0;
Node lvalue;
int type = lhs.getType();
if (type == Token.VAR || type == Token.... | [
"private",
"Node",
"createForIn",
"(",
"int",
"declType",
",",
"Node",
"loop",
",",
"Node",
"lhs",
",",
"Node",
"obj",
",",
"Node",
"body",
",",
"boolean",
"isForEach",
",",
"boolean",
"isForOf",
")",
"{",
"int",
"destructuring",
"=",
"-",
"1",
";",
"i... | Generate IR for a for..in loop. | [
"Generate",
"IR",
"for",
"a",
"for",
"..",
"in",
"loop",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/IRFactory.java#L1586-L1661 |
21,548 | mozilla/rhino | src/org/mozilla/javascript/IRFactory.java | IRFactory.isAlwaysDefinedBoolean | private static int isAlwaysDefinedBoolean(Node node) {
switch (node.getType()) {
case Token.FALSE:
case Token.NULL:
return ALWAYS_FALSE_BOOLEAN;
case Token.TRUE:
return ALWAYS_TRUE_BOOLEAN;
case Token.NUMBER: {
double num = node.getDoub... | java | private static int isAlwaysDefinedBoolean(Node node) {
switch (node.getType()) {
case Token.FALSE:
case Token.NULL:
return ALWAYS_FALSE_BOOLEAN;
case Token.TRUE:
return ALWAYS_TRUE_BOOLEAN;
case Token.NUMBER: {
double num = node.getDoub... | [
"private",
"static",
"int",
"isAlwaysDefinedBoolean",
"(",
"Node",
"node",
")",
"{",
"switch",
"(",
"node",
".",
"getType",
"(",
")",
")",
"{",
"case",
"Token",
".",
"FALSE",
":",
"case",
"Token",
".",
"NULL",
":",
"return",
"ALWAYS_FALSE_BOOLEAN",
";",
... | Check if Node always mean true or false in boolean context | [
"Check",
"if",
"Node",
"always",
"mean",
"true",
"or",
"false",
"in",
"boolean",
"context"
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/IRFactory.java#L2319-L2335 |
21,549 | mozilla/rhino | src/org/mozilla/javascript/InterpretedFunction.java | InterpretedFunction.createScript | static InterpretedFunction createScript(InterpreterData idata,
Object staticSecurityDomain)
{
InterpretedFunction f;
f = new InterpretedFunction(idata, staticSecurityDomain);
return f;
} | java | static InterpretedFunction createScript(InterpreterData idata,
Object staticSecurityDomain)
{
InterpretedFunction f;
f = new InterpretedFunction(idata, staticSecurityDomain);
return f;
} | [
"static",
"InterpretedFunction",
"createScript",
"(",
"InterpreterData",
"idata",
",",
"Object",
"staticSecurityDomain",
")",
"{",
"InterpretedFunction",
"f",
";",
"f",
"=",
"new",
"InterpretedFunction",
"(",
"idata",
",",
"staticSecurityDomain",
")",
";",
"return",
... | Create script from compiled bytecode. | [
"Create",
"script",
"from",
"compiled",
"bytecode",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/InterpretedFunction.java#L53-L59 |
21,550 | mozilla/rhino | src/org/mozilla/javascript/InterpretedFunction.java | InterpretedFunction.createFunction | static InterpretedFunction createFunction(Context cx, Scriptable scope,
InterpretedFunction parent,
int index)
{
InterpretedFunction f = new InterpretedFunction(parent, index);
f.initScriptFunction(cx, scope)... | java | static InterpretedFunction createFunction(Context cx, Scriptable scope,
InterpretedFunction parent,
int index)
{
InterpretedFunction f = new InterpretedFunction(parent, index);
f.initScriptFunction(cx, scope)... | [
"static",
"InterpretedFunction",
"createFunction",
"(",
"Context",
"cx",
",",
"Scriptable",
"scope",
",",
"InterpretedFunction",
"parent",
",",
"int",
"index",
")",
"{",
"InterpretedFunction",
"f",
"=",
"new",
"InterpretedFunction",
"(",
"parent",
",",
"index",
")... | Create function embedded in script or another function. | [
"Create",
"function",
"embedded",
"in",
"script",
"or",
"another",
"function",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/InterpretedFunction.java#L77-L84 |
21,551 | mozilla/rhino | src/org/mozilla/javascript/InterpretedFunction.java | InterpretedFunction.call | @Override
public Object call(Context cx, Scriptable scope, Scriptable thisObj,
Object[] args)
{
if (!ScriptRuntime.hasTopCall(cx)) {
return ScriptRuntime.doTopCall(this, cx, scope, thisObj, args, idata.isStrict);
}
return Interpreter.interpret(this, cx,... | java | @Override
public Object call(Context cx, Scriptable scope, Scriptable thisObj,
Object[] args)
{
if (!ScriptRuntime.hasTopCall(cx)) {
return ScriptRuntime.doTopCall(this, cx, scope, thisObj, args, idata.isStrict);
}
return Interpreter.interpret(this, cx,... | [
"@",
"Override",
"public",
"Object",
"call",
"(",
"Context",
"cx",
",",
"Scriptable",
"scope",
",",
"Scriptable",
"thisObj",
",",
"Object",
"[",
"]",
"args",
")",
"{",
"if",
"(",
"!",
"ScriptRuntime",
".",
"hasTopCall",
"(",
"cx",
")",
")",
"{",
"retur... | Calls the function.
@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
{@link ScriptRuntime#emptyArgs} to pass empty arguments.
@return the result of the function call. | [
"Calls",
"the",
"function",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/InterpretedFunction.java#L102-L110 |
21,552 | mozilla/rhino | src/org/mozilla/javascript/ast/ObjectLiteral.java | ObjectLiteral.setElements | public void setElements(List<ObjectProperty> elements) {
if (elements == null) {
this.elements = null;
} else {
if (this.elements != null)
this.elements.clear();
for (ObjectProperty o : elements)
addElement(o);
}
} | java | public void setElements(List<ObjectProperty> elements) {
if (elements == null) {
this.elements = null;
} else {
if (this.elements != null)
this.elements.clear();
for (ObjectProperty o : elements)
addElement(o);
}
} | [
"public",
"void",
"setElements",
"(",
"List",
"<",
"ObjectProperty",
">",
"elements",
")",
"{",
"if",
"(",
"elements",
"==",
"null",
")",
"{",
"this",
".",
"elements",
"=",
"null",
";",
"}",
"else",
"{",
"if",
"(",
"this",
".",
"elements",
"!=",
"nul... | Sets the element list, and updates the parent of each element.
Replaces any existing elements.
@param elements the element list. Can be {@code null}. | [
"Sets",
"the",
"element",
"list",
"and",
"updates",
"the",
"parent",
"of",
"each",
"element",
".",
"Replaces",
"any",
"existing",
"elements",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ast/ObjectLiteral.java#L69-L78 |
21,553 | mozilla/rhino | src/org/mozilla/javascript/ast/ObjectLiteral.java | ObjectLiteral.addElement | public void addElement(ObjectProperty element) {
assertNotNull(element);
if (elements == null) {
elements = new ArrayList<ObjectProperty>();
}
elements.add(element);
element.setParent(this);
} | java | public void addElement(ObjectProperty element) {
assertNotNull(element);
if (elements == null) {
elements = new ArrayList<ObjectProperty>();
}
elements.add(element);
element.setParent(this);
} | [
"public",
"void",
"addElement",
"(",
"ObjectProperty",
"element",
")",
"{",
"assertNotNull",
"(",
"element",
")",
";",
"if",
"(",
"elements",
"==",
"null",
")",
"{",
"elements",
"=",
"new",
"ArrayList",
"<",
"ObjectProperty",
">",
"(",
")",
";",
"}",
"el... | Adds an element to the list, and sets its parent to this node.
@param element the property node to append to the end of the list
@throws IllegalArgumentException} if element is {@code null} | [
"Adds",
"an",
"element",
"to",
"the",
"list",
"and",
"sets",
"its",
"parent",
"to",
"this",
"node",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ast/ObjectLiteral.java#L85-L92 |
21,554 | mozilla/rhino | src/org/mozilla/javascript/NativeIterator.java | NativeIterator.getStopIterationObject | public static Object getStopIterationObject(Scriptable scope) {
Scriptable top = ScriptableObject.getTopLevelScope(scope);
return ScriptableObject.getTopScopeValue(top, ITERATOR_TAG);
} | java | public static Object getStopIterationObject(Scriptable scope) {
Scriptable top = ScriptableObject.getTopLevelScope(scope);
return ScriptableObject.getTopScopeValue(top, ITERATOR_TAG);
} | [
"public",
"static",
"Object",
"getStopIterationObject",
"(",
"Scriptable",
"scope",
")",
"{",
"Scriptable",
"top",
"=",
"ScriptableObject",
".",
"getTopLevelScope",
"(",
"scope",
")",
";",
"return",
"ScriptableObject",
".",
"getTopScopeValue",
"(",
"top",
",",
"IT... | Get the value of the "StopIteration" object. Note that this value
is stored in the top-level scope using "associateValue" so the
value can still be found even if a script overwrites or deletes
the global "StopIteration" property.
@param scope a scope whose parent chain reaches a top-level scope
@return the StopIteratio... | [
"Get",
"the",
"value",
"of",
"the",
"StopIteration",
"object",
".",
"Note",
"that",
"this",
"value",
"is",
"stored",
"in",
"the",
"top",
"-",
"level",
"scope",
"using",
"associateValue",
"so",
"the",
"value",
"can",
"still",
"be",
"found",
"even",
"if",
... | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/NativeIterator.java#L60-L63 |
21,555 | mozilla/rhino | src/org/mozilla/javascript/ast/XmlPropRef.java | XmlPropRef.visit | @Override
public void visit(NodeVisitor v) {
if (v.visit(this)) {
if (namespace != null) {
namespace.visit(v);
}
propName.visit(v);
}
} | java | @Override
public void visit(NodeVisitor v) {
if (v.visit(this)) {
if (namespace != null) {
namespace.visit(v);
}
propName.visit(v);
}
} | [
"@",
"Override",
"public",
"void",
"visit",
"(",
"NodeVisitor",
"v",
")",
"{",
"if",
"(",
"v",
".",
"visit",
"(",
"this",
")",
")",
"{",
"if",
"(",
"namespace",
"!=",
"null",
")",
"{",
"namespace",
".",
"visit",
"(",
"v",
")",
";",
"}",
"propName... | Visits this node, then the namespace if present, then the property name. | [
"Visits",
"this",
"node",
"then",
"the",
"namespace",
"if",
"present",
"then",
"the",
"property",
"name",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ast/XmlPropRef.java#L82-L90 |
21,556 | mozilla/rhino | src/org/mozilla/javascript/SlotMapContainer.java | SlotMapContainer.checkMapSize | protected void checkMapSize()
{
if ((map instanceof EmbeddedSlotMap) && map.size() >= LARGE_HASH_SIZE) {
SlotMap newMap = new HashSlotMap();
for (Slot s : map) {
newMap.addSlot(s);
}
map = newMap;
}
} | java | protected void checkMapSize()
{
if ((map instanceof EmbeddedSlotMap) && map.size() >= LARGE_HASH_SIZE) {
SlotMap newMap = new HashSlotMap();
for (Slot s : map) {
newMap.addSlot(s);
}
map = newMap;
}
} | [
"protected",
"void",
"checkMapSize",
"(",
")",
"{",
"if",
"(",
"(",
"map",
"instanceof",
"EmbeddedSlotMap",
")",
"&&",
"map",
".",
"size",
"(",
")",
">=",
"LARGE_HASH_SIZE",
")",
"{",
"SlotMap",
"newMap",
"=",
"new",
"HashSlotMap",
"(",
")",
";",
"for",
... | Before inserting a new item in the map, check and see if we need to expand from the embedded
map to a HashMap that is more robust against large numbers of hash collisions. | [
"Before",
"inserting",
"a",
"new",
"item",
"in",
"the",
"map",
"check",
"and",
"see",
"if",
"we",
"need",
"to",
"expand",
"from",
"the",
"embedded",
"map",
"to",
"a",
"HashMap",
"that",
"is",
"more",
"robust",
"against",
"large",
"numbers",
"of",
"hash",... | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/SlotMapContainer.java#L100-L109 |
21,557 | mozilla/rhino | src/org/mozilla/javascript/NativeObject.java | NativeObject.containsKey | @Override
public boolean containsKey(Object key) {
if (key instanceof String) {
return has((String) key, this);
} else if (key instanceof Number) {
return has(((Number) key).intValue(), this);
}
return false;
} | java | @Override
public boolean containsKey(Object key) {
if (key instanceof String) {
return has((String) key, this);
} else if (key instanceof Number) {
return has(((Number) key).intValue(), this);
}
return false;
} | [
"@",
"Override",
"public",
"boolean",
"containsKey",
"(",
"Object",
"key",
")",
"{",
"if",
"(",
"key",
"instanceof",
"String",
")",
"{",
"return",
"has",
"(",
"(",
"String",
")",
"key",
",",
"this",
")",
";",
"}",
"else",
"if",
"(",
"key",
"instanceo... | methods implementing java.util.Map | [
"methods",
"implementing",
"java",
".",
"util",
".",
"Map"
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/NativeObject.java#L549-L557 |
21,558 | mozilla/rhino | toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java | SwingGui.setVisible | @Override
public void setVisible(boolean b) {
super.setVisible(b);
if (b) {
// this needs to be done after the window is visible
console.consoleTextArea.requestFocus();
context.split.setDividerLocation(0.5);
try {
console.setMaximum(tru... | java | @Override
public void setVisible(boolean b) {
super.setVisible(b);
if (b) {
// this needs to be done after the window is visible
console.consoleTextArea.requestFocus();
context.split.setDividerLocation(0.5);
try {
console.setMaximum(tru... | [
"@",
"Override",
"public",
"void",
"setVisible",
"(",
"boolean",
"b",
")",
"{",
"super",
".",
"setVisible",
"(",
"b",
")",
";",
"if",
"(",
"b",
")",
"{",
"// this needs to be done after the window is visible",
"console",
".",
"consoleTextArea",
".",
"requestFocu... | Sets the visibility of the debugger GUI. | [
"Sets",
"the",
"visibility",
"of",
"the",
"debugger",
"GUI",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java#L241-L256 |
21,559 | mozilla/rhino | toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java | SwingGui.addTopLevel | void addTopLevel(String key, JFrame frame) {
if (frame != this) {
toplevels.put(key, frame);
}
} | java | void addTopLevel(String key, JFrame frame) {
if (frame != this) {
toplevels.put(key, frame);
}
} | [
"void",
"addTopLevel",
"(",
"String",
"key",
",",
"JFrame",
"frame",
")",
"{",
"if",
"(",
"frame",
"!=",
"this",
")",
"{",
"toplevels",
".",
"put",
"(",
"key",
",",
"frame",
")",
";",
"}",
"}"
] | Records a new internal frame. | [
"Records",
"a",
"new",
"internal",
"frame",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java#L261-L265 |
21,560 | mozilla/rhino | toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java | SwingGui.getShortName | static String getShortName(String url) {
int lastSlash = url.lastIndexOf('/');
if (lastSlash < 0) {
lastSlash = url.lastIndexOf('\\');
}
String shortName = url;
if (lastSlash >= 0 && lastSlash + 1 < url.length()) {
shortName = url.substring(lastSlash + 1);... | java | static String getShortName(String url) {
int lastSlash = url.lastIndexOf('/');
if (lastSlash < 0) {
lastSlash = url.lastIndexOf('\\');
}
String shortName = url;
if (lastSlash >= 0 && lastSlash + 1 < url.length()) {
shortName = url.substring(lastSlash + 1);... | [
"static",
"String",
"getShortName",
"(",
"String",
"url",
")",
"{",
"int",
"lastSlash",
"=",
"url",
".",
"lastIndexOf",
"(",
"'",
"'",
")",
";",
"if",
"(",
"lastSlash",
"<",
"0",
")",
"{",
"lastSlash",
"=",
"url",
".",
"lastIndexOf",
"(",
"'",
"'",
... | Returns a short version of the given URL. | [
"Returns",
"a",
"short",
"version",
"of",
"the",
"given",
"URL",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java#L418-L428 |
21,561 | mozilla/rhino | toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java | SwingGui.showStopLine | void showStopLine(Dim.StackFrame frame) {
String sourceName = frame.getUrl();
if (sourceName == null || sourceName.equals("<stdin>")) {
if (console.isVisible()) {
console.show();
}
} else {
showFileWindow(sourceName, -1);
int lineNu... | java | void showStopLine(Dim.StackFrame frame) {
String sourceName = frame.getUrl();
if (sourceName == null || sourceName.equals("<stdin>")) {
if (console.isVisible()) {
console.show();
}
} else {
showFileWindow(sourceName, -1);
int lineNu... | [
"void",
"showStopLine",
"(",
"Dim",
".",
"StackFrame",
"frame",
")",
"{",
"String",
"sourceName",
"=",
"frame",
".",
"getUrl",
"(",
")",
";",
"if",
"(",
"sourceName",
"==",
"null",
"||",
"sourceName",
".",
"equals",
"(",
"\"<stdin>\"",
")",
")",
"{",
"... | Shows the line at which execution in the given stack frame just stopped. | [
"Shows",
"the",
"line",
"at",
"which",
"execution",
"in",
"the",
"given",
"stack",
"frame",
"just",
"stopped",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java#L489-L503 |
21,562 | mozilla/rhino | toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java | SwingGui.enterInterruptImpl | void enterInterruptImpl(Dim.StackFrame lastFrame,
String threadTitle, String alertMessage) {
statusBar.setText("Thread: " + threadTitle);
showStopLine(lastFrame);
if (alertMessage != null) {
MessageDialogWrapper.showMessageDialog(this,
... | java | void enterInterruptImpl(Dim.StackFrame lastFrame,
String threadTitle, String alertMessage) {
statusBar.setText("Thread: " + threadTitle);
showStopLine(lastFrame);
if (alertMessage != null) {
MessageDialogWrapper.showMessageDialog(this,
... | [
"void",
"enterInterruptImpl",
"(",
"Dim",
".",
"StackFrame",
"lastFrame",
",",
"String",
"threadTitle",
",",
"String",
"alertMessage",
")",
"{",
"statusBar",
".",
"setText",
"(",
"\"Thread: \"",
"+",
"threadTitle",
")",
";",
"showStopLine",
"(",
"lastFrame",
")"... | Handles script interruption. | [
"Handles",
"script",
"interruption",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java#L658-L700 |
21,563 | mozilla/rhino | toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java | SwingGui.getSelectedFrame | private JInternalFrame getSelectedFrame() {
JInternalFrame[] frames = desk.getAllFrames();
for (int i = 0; i < frames.length; i++) {
if (frames[i].isShowing()) {
return frames[i];
}
}
return frames[frames.length - 1];
} | java | private JInternalFrame getSelectedFrame() {
JInternalFrame[] frames = desk.getAllFrames();
for (int i = 0; i < frames.length; i++) {
if (frames[i].isShowing()) {
return frames[i];
}
}
return frames[frames.length - 1];
} | [
"private",
"JInternalFrame",
"getSelectedFrame",
"(",
")",
"{",
"JInternalFrame",
"[",
"]",
"frames",
"=",
"desk",
".",
"getAllFrames",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"frames",
".",
"length",
";",
"i",
"++",
")",
"{",... | Returns the current selected internal frame. | [
"Returns",
"the",
"current",
"selected",
"internal",
"frame",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java#L741-L749 |
21,564 | mozilla/rhino | toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java | SwingGui.updateEnabled | private void updateEnabled(boolean interrupted) {
((Menubar)getJMenuBar()).updateEnabled(interrupted);
for (int ci = 0, cc = toolBar.getComponentCount(); ci < cc; ci++) {
boolean enableButton;
if (ci == 0) {
// Break
enableButton = !interrupted;
... | java | private void updateEnabled(boolean interrupted) {
((Menubar)getJMenuBar()).updateEnabled(interrupted);
for (int ci = 0, cc = toolBar.getComponentCount(); ci < cc; ci++) {
boolean enableButton;
if (ci == 0) {
// Break
enableButton = !interrupted;
... | [
"private",
"void",
"updateEnabled",
"(",
"boolean",
"interrupted",
")",
"{",
"(",
"(",
"Menubar",
")",
"getJMenuBar",
"(",
")",
")",
".",
"updateEnabled",
"(",
"interrupted",
")",
";",
"for",
"(",
"int",
"ci",
"=",
"0",
",",
"cc",
"=",
"toolBar",
".",
... | Enables or disables the menu and tool bars with respect to the
state of script execution. | [
"Enables",
"or",
"disables",
"the",
"menu",
"and",
"tool",
"bars",
"with",
"respect",
"to",
"the",
"state",
"of",
"script",
"execution",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java#L755-L780 |
21,565 | mozilla/rhino | toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java | SwingGui.readFile | private String readFile(String fileName) {
String text;
try {
try (Reader r = new FileReader(fileName)) {
text = Kit.readReader(r);
}
} catch (IOException ex) {
MessageDialogWrapper.showMessageDialog(this,
... | java | private String readFile(String fileName) {
String text;
try {
try (Reader r = new FileReader(fileName)) {
text = Kit.readReader(r);
}
} catch (IOException ex) {
MessageDialogWrapper.showMessageDialog(this,
... | [
"private",
"String",
"readFile",
"(",
"String",
"fileName",
")",
"{",
"String",
"text",
";",
"try",
"{",
"try",
"(",
"Reader",
"r",
"=",
"new",
"FileReader",
"(",
"fileName",
")",
")",
"{",
"text",
"=",
"Kit",
".",
"readReader",
"(",
"r",
")",
";",
... | Reads the file with the given name and returns its contents as a String. | [
"Reads",
"the",
"file",
"with",
"the",
"given",
"name",
"and",
"returns",
"its",
"contents",
"as",
"a",
"String",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java#L800-L814 |
21,566 | mozilla/rhino | toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java | SwingGui.updateSourceText | @Override
public void updateSourceText(Dim.SourceInfo sourceInfo) {
RunProxy proxy = new RunProxy(this, RunProxy.UPDATE_SOURCE_TEXT);
proxy.sourceInfo = sourceInfo;
SwingUtilities.invokeLater(proxy);
} | java | @Override
public void updateSourceText(Dim.SourceInfo sourceInfo) {
RunProxy proxy = new RunProxy(this, RunProxy.UPDATE_SOURCE_TEXT);
proxy.sourceInfo = sourceInfo;
SwingUtilities.invokeLater(proxy);
} | [
"@",
"Override",
"public",
"void",
"updateSourceText",
"(",
"Dim",
".",
"SourceInfo",
"sourceInfo",
")",
"{",
"RunProxy",
"proxy",
"=",
"new",
"RunProxy",
"(",
"this",
",",
"RunProxy",
".",
"UPDATE_SOURCE_TEXT",
")",
";",
"proxy",
".",
"sourceInfo",
"=",
"so... | Called when the source text for a script has been updated. | [
"Called",
"when",
"the",
"source",
"text",
"for",
"a",
"script",
"has",
"been",
"updated",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java#L821-L826 |
21,567 | mozilla/rhino | toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java | SwingGui.enterInterrupt | @Override
public void enterInterrupt(Dim.StackFrame lastFrame,
String threadTitle,
String alertMessage) {
if (SwingUtilities.isEventDispatchThread()) {
enterInterruptImpl(lastFrame, threadTitle, alertMessage);
} else {
... | java | @Override
public void enterInterrupt(Dim.StackFrame lastFrame,
String threadTitle,
String alertMessage) {
if (SwingUtilities.isEventDispatchThread()) {
enterInterruptImpl(lastFrame, threadTitle, alertMessage);
} else {
... | [
"@",
"Override",
"public",
"void",
"enterInterrupt",
"(",
"Dim",
".",
"StackFrame",
"lastFrame",
",",
"String",
"threadTitle",
",",
"String",
"alertMessage",
")",
"{",
"if",
"(",
"SwingUtilities",
".",
"isEventDispatchThread",
"(",
")",
")",
"{",
"enterInterrupt... | Called when the interrupt loop has been entered. | [
"Called",
"when",
"the",
"interrupt",
"loop",
"has",
"been",
"entered",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java#L831-L844 |
21,568 | mozilla/rhino | toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java | SwingGui.dispatchNextGuiEvent | @Override
public void dispatchNextGuiEvent() throws InterruptedException {
EventQueue queue = awtEventQueue;
if (queue == null) {
queue = Toolkit.getDefaultToolkit().getSystemEventQueue();
awtEventQueue = queue;
}
AWTEvent event = queue.getNextEvent();
... | java | @Override
public void dispatchNextGuiEvent() throws InterruptedException {
EventQueue queue = awtEventQueue;
if (queue == null) {
queue = Toolkit.getDefaultToolkit().getSystemEventQueue();
awtEventQueue = queue;
}
AWTEvent event = queue.getNextEvent();
... | [
"@",
"Override",
"public",
"void",
"dispatchNextGuiEvent",
"(",
")",
"throws",
"InterruptedException",
"{",
"EventQueue",
"queue",
"=",
"awtEventQueue",
";",
"if",
"(",
"queue",
"==",
"null",
")",
"{",
"queue",
"=",
"Toolkit",
".",
"getDefaultToolkit",
"(",
")... | Processes the next GUI event. | [
"Processes",
"the",
"next",
"GUI",
"event",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java#L857-L876 |
21,569 | mozilla/rhino | toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java | EvalTextArea.returnPressed | private synchronized void returnPressed() {
Document doc = getDocument();
int len = doc.getLength();
Segment segment = new Segment();
try {
doc.getText(outputMark, len - outputMark, segment);
} catch (javax.swing.text.BadLocationException ignored) {
ignore... | java | private synchronized void returnPressed() {
Document doc = getDocument();
int len = doc.getLength();
Segment segment = new Segment();
try {
doc.getText(outputMark, len - outputMark, segment);
} catch (javax.swing.text.BadLocationException ignored) {
ignore... | [
"private",
"synchronized",
"void",
"returnPressed",
"(",
")",
"{",
"Document",
"doc",
"=",
"getDocument",
"(",
")",
";",
"int",
"len",
"=",
"doc",
".",
"getLength",
"(",
")",
";",
"Segment",
"segment",
"=",
"new",
"Segment",
"(",
")",
";",
"try",
"{",
... | Called when Enter is pressed. | [
"Called",
"when",
"Enter",
"is",
"pressed",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java#L1139-L1165 |
21,570 | mozilla/rhino | toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java | EvalTextArea.insertUpdate | @Override
public synchronized void insertUpdate(DocumentEvent e) {
int len = e.getLength();
int off = e.getOffset();
if (outputMark > off) {
outputMark += len;
}
} | java | @Override
public synchronized void insertUpdate(DocumentEvent e) {
int len = e.getLength();
int off = e.getOffset();
if (outputMark > off) {
outputMark += len;
}
} | [
"@",
"Override",
"public",
"synchronized",
"void",
"insertUpdate",
"(",
"DocumentEvent",
"e",
")",
"{",
"int",
"len",
"=",
"e",
".",
"getLength",
"(",
")",
";",
"int",
"off",
"=",
"e",
".",
"getOffset",
"(",
")",
";",
"if",
"(",
"outputMark",
">",
"o... | Called when text was inserted into the text area. | [
"Called",
"when",
"text",
"was",
"inserted",
"into",
"the",
"text",
"area",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java#L1272-L1279 |
21,571 | mozilla/rhino | toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java | EvalTextArea.removeUpdate | @Override
public synchronized void removeUpdate(DocumentEvent e) {
int len = e.getLength();
int off = e.getOffset();
if (outputMark > off) {
if (outputMark >= off + len) {
outputMark -= len;
} else {
outputMark = off;
}
... | java | @Override
public synchronized void removeUpdate(DocumentEvent e) {
int len = e.getLength();
int off = e.getOffset();
if (outputMark > off) {
if (outputMark >= off + len) {
outputMark -= len;
} else {
outputMark = off;
}
... | [
"@",
"Override",
"public",
"synchronized",
"void",
"removeUpdate",
"(",
"DocumentEvent",
"e",
")",
"{",
"int",
"len",
"=",
"e",
".",
"getLength",
"(",
")",
";",
"int",
"off",
"=",
"e",
".",
"getOffset",
"(",
")",
";",
"if",
"(",
"outputMark",
">",
"o... | Called when text was removed from the text area. | [
"Called",
"when",
"text",
"was",
"removed",
"from",
"the",
"text",
"area",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java#L1284-L1295 |
21,572 | mozilla/rhino | toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java | JSInternalConsole.actionPerformed | @Override
public void actionPerformed(ActionEvent e) {
String cmd = e.getActionCommand();
if (cmd.equals("Cut")) {
consoleTextArea.cut();
} else if (cmd.equals("Copy")) {
consoleTextArea.copy();
} else if (cmd.equals("Paste")) {
consoleTextArea.pas... | java | @Override
public void actionPerformed(ActionEvent e) {
String cmd = e.getActionCommand();
if (cmd.equals("Cut")) {
consoleTextArea.cut();
} else if (cmd.equals("Copy")) {
consoleTextArea.copy();
} else if (cmd.equals("Paste")) {
consoleTextArea.pas... | [
"@",
"Override",
"public",
"void",
"actionPerformed",
"(",
"ActionEvent",
"e",
")",
"{",
"String",
"cmd",
"=",
"e",
".",
"getActionCommand",
"(",
")",
";",
"if",
"(",
"cmd",
".",
"equals",
"(",
"\"Cut\"",
")",
")",
"{",
"consoleTextArea",
".",
"cut",
"... | Performs an action on the text area. | [
"Performs",
"an",
"action",
"on",
"the",
"text",
"area",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java#L1435-L1445 |
21,573 | mozilla/rhino | toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java | FilePopupMenu.show | public void show(JComponent comp, int x, int y) {
this.x = x;
this.y = y;
super.show(comp, x, y);
} | java | public void show(JComponent comp, int x, int y) {
this.x = x;
this.y = y;
super.show(comp, x, y);
} | [
"public",
"void",
"show",
"(",
"JComponent",
"comp",
",",
"int",
"x",
",",
"int",
"y",
")",
"{",
"this",
".",
"x",
"=",
"x",
";",
"this",
".",
"y",
"=",
"y",
";",
"super",
".",
"show",
"(",
"comp",
",",
"x",
",",
"y",
")",
";",
"}"
] | Displays the menu at the given coordinates. | [
"Displays",
"the",
"menu",
"at",
"the",
"given",
"coordinates",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java#L1484-L1488 |
21,574 | mozilla/rhino | toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java | FileTextArea.select | public void select(int pos) {
if (pos >= 0) {
try {
int line = getLineOfOffset(pos);
Rectangle rect = modelToView(pos);
if (rect == null) {
select(pos, pos);
} else {
try {
... | java | public void select(int pos) {
if (pos >= 0) {
try {
int line = getLineOfOffset(pos);
Rectangle rect = modelToView(pos);
if (rect == null) {
select(pos, pos);
} else {
try {
... | [
"public",
"void",
"select",
"(",
"int",
"pos",
")",
"{",
"if",
"(",
"pos",
">=",
"0",
")",
"{",
"try",
"{",
"int",
"line",
"=",
"getLineOfOffset",
"(",
"pos",
")",
";",
"Rectangle",
"rect",
"=",
"modelToView",
"(",
"pos",
")",
";",
"if",
"(",
"re... | Moves the selection to the given offset. | [
"Moves",
"the",
"selection",
"to",
"the",
"given",
"offset",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java#L1528-L1561 |
21,575 | mozilla/rhino | toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java | FileTextArea.checkPopup | private void checkPopup(MouseEvent e) {
if (e.isPopupTrigger()) {
popup.show(this, e.getX(), e.getY());
}
} | java | private void checkPopup(MouseEvent e) {
if (e.isPopupTrigger()) {
popup.show(this, e.getX(), e.getY());
}
} | [
"private",
"void",
"checkPopup",
"(",
"MouseEvent",
"e",
")",
"{",
"if",
"(",
"e",
".",
"isPopupTrigger",
"(",
")",
")",
"{",
"popup",
".",
"show",
"(",
"this",
",",
"e",
".",
"getX",
"(",
")",
",",
"e",
".",
"getY",
"(",
")",
")",
";",
"}",
... | Checks if the popup menu should be shown. | [
"Checks",
"if",
"the",
"popup",
"menu",
"should",
"be",
"shown",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java#L1566-L1570 |
21,576 | mozilla/rhino | toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java | FileTextArea.mouseClicked | @Override
public void mouseClicked(MouseEvent e) {
checkPopup(e);
requestFocus();
getCaret().setVisible(true);
} | java | @Override
public void mouseClicked(MouseEvent e) {
checkPopup(e);
requestFocus();
getCaret().setVisible(true);
} | [
"@",
"Override",
"public",
"void",
"mouseClicked",
"(",
"MouseEvent",
"e",
")",
"{",
"checkPopup",
"(",
"e",
")",
";",
"requestFocus",
"(",
")",
";",
"getCaret",
"(",
")",
".",
"setVisible",
"(",
"true",
")",
";",
"}"
] | Called when the mouse is clicked. | [
"Called",
"when",
"the",
"mouse",
"is",
"clicked",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java#L1585-L1590 |
21,577 | mozilla/rhino | toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java | FileTextArea.keyPressed | @Override
public void keyPressed(KeyEvent e) {
switch (e.getKeyCode()) {
case KeyEvent.VK_BACK_SPACE:
case KeyEvent.VK_ENTER:
case KeyEvent.VK_DELETE:
case KeyEvent.VK_TAB:
e.consume();
break;
}
} | java | @Override
public void keyPressed(KeyEvent e) {
switch (e.getKeyCode()) {
case KeyEvent.VK_BACK_SPACE:
case KeyEvent.VK_ENTER:
case KeyEvent.VK_DELETE:
case KeyEvent.VK_TAB:
e.consume();
break;
}
} | [
"@",
"Override",
"public",
"void",
"keyPressed",
"(",
"KeyEvent",
"e",
")",
"{",
"switch",
"(",
"e",
".",
"getKeyCode",
"(",
")",
")",
"{",
"case",
"KeyEvent",
".",
"VK_BACK_SPACE",
":",
"case",
"KeyEvent",
".",
"VK_ENTER",
":",
"case",
"KeyEvent",
".",
... | Called when a key is pressed. | [
"Called",
"when",
"a",
"key",
"is",
"pressed",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java#L1666-L1676 |
21,578 | mozilla/rhino | toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java | MoreWindows.showDialog | public String showDialog(Component comp) {
value = null;
setLocationRelativeTo(comp);
setVisible(true);
return value;
} | java | public String showDialog(Component comp) {
value = null;
setLocationRelativeTo(comp);
setVisible(true);
return value;
} | [
"public",
"String",
"showDialog",
"(",
"Component",
"comp",
")",
"{",
"value",
"=",
"null",
";",
"setLocationRelativeTo",
"(",
"comp",
")",
";",
"setVisible",
"(",
"true",
")",
";",
"return",
"value",
";",
"}"
] | Shows the dialog. | [
"Shows",
"the",
"dialog",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java#L1807-L1812 |
21,579 | mozilla/rhino | toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java | FileHeader.update | public void update() {
FileTextArea textArea = fileWindow.textArea;
Font font = textArea.getFont();
setFont(font);
FontMetrics metrics = getFontMetrics(font);
int h = metrics.getHeight();
int lineCount = textArea.getLineCount() + 1;
String dummy = Integer.toString... | java | public void update() {
FileTextArea textArea = fileWindow.textArea;
Font font = textArea.getFont();
setFont(font);
FontMetrics metrics = getFontMetrics(font);
int h = metrics.getHeight();
int lineCount = textArea.getLineCount() + 1;
String dummy = Integer.toString... | [
"public",
"void",
"update",
"(",
")",
"{",
"FileTextArea",
"textArea",
"=",
"fileWindow",
".",
"textArea",
";",
"Font",
"font",
"=",
"textArea",
".",
"getFont",
"(",
")",
";",
"setFont",
"(",
"font",
")",
";",
"FontMetrics",
"metrics",
"=",
"getFontMetrics... | Updates the gutter. | [
"Updates",
"the",
"gutter",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java#L2038-L2054 |
21,580 | mozilla/rhino | toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java | FileHeader.mousePressed | @Override
public void mousePressed(MouseEvent e) {
Font font = fileWindow.textArea.getFont();
FontMetrics metrics = getFontMetrics(font);
int h = metrics.getHeight();
pressLine = e.getY() / h;
} | java | @Override
public void mousePressed(MouseEvent e) {
Font font = fileWindow.textArea.getFont();
FontMetrics metrics = getFontMetrics(font);
int h = metrics.getHeight();
pressLine = e.getY() / h;
} | [
"@",
"Override",
"public",
"void",
"mousePressed",
"(",
"MouseEvent",
"e",
")",
"{",
"Font",
"font",
"=",
"fileWindow",
".",
"textArea",
".",
"getFont",
"(",
")",
";",
"FontMetrics",
"metrics",
"=",
"getFontMetrics",
"(",
"font",
")",
";",
"int",
"h",
"=... | Called when a mouse button is pressed. | [
"Called",
"when",
"a",
"mouse",
"button",
"is",
"pressed",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java#L2135-L2141 |
21,581 | mozilla/rhino | toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java | FileWindow.load | void load() {
String url = getUrl();
if (url != null) {
RunProxy proxy = new RunProxy(debugGui, RunProxy.LOAD_FILE);
proxy.fileName = url;
proxy.text = sourceInfo.source();
new Thread(proxy).start();
}
} | java | void load() {
String url = getUrl();
if (url != null) {
RunProxy proxy = new RunProxy(debugGui, RunProxy.LOAD_FILE);
proxy.fileName = url;
proxy.text = sourceInfo.source();
new Thread(proxy).start();
}
} | [
"void",
"load",
"(",
")",
"{",
"String",
"url",
"=",
"getUrl",
"(",
")",
";",
"if",
"(",
"url",
"!=",
"null",
")",
"{",
"RunProxy",
"proxy",
"=",
"new",
"RunProxy",
"(",
"debugGui",
",",
"RunProxy",
".",
"LOAD_FILE",
")",
";",
"proxy",
".",
"fileNa... | Loads the file. | [
"Loads",
"the",
"file",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java#L2221-L2229 |
21,582 | mozilla/rhino | toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java | FileWindow.getPosition | public int getPosition(int line) {
int result = -1;
try {
result = textArea.getLineStartOffset(line);
} catch (javax.swing.text.BadLocationException exc) {
}
return result;
} | java | public int getPosition(int line) {
int result = -1;
try {
result = textArea.getLineStartOffset(line);
} catch (javax.swing.text.BadLocationException exc) {
}
return result;
} | [
"public",
"int",
"getPosition",
"(",
"int",
"line",
")",
"{",
"int",
"result",
"=",
"-",
"1",
";",
"try",
"{",
"result",
"=",
"textArea",
".",
"getLineStartOffset",
"(",
"line",
")",
";",
"}",
"catch",
"(",
"javax",
".",
"swing",
".",
"text",
".",
... | Returns the offset position for the given line. | [
"Returns",
"the",
"offset",
"position",
"for",
"the",
"given",
"line",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java#L2234-L2241 |
21,583 | mozilla/rhino | toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java | FileWindow.setBreakPoint | public void setBreakPoint(int line) {
if (sourceInfo.breakableLine(line)) {
boolean changed = sourceInfo.breakpoint(line, true);
if (changed) {
fileHeader.repaint();
}
}
} | java | public void setBreakPoint(int line) {
if (sourceInfo.breakableLine(line)) {
boolean changed = sourceInfo.breakpoint(line, true);
if (changed) {
fileHeader.repaint();
}
}
} | [
"public",
"void",
"setBreakPoint",
"(",
"int",
"line",
")",
"{",
"if",
"(",
"sourceInfo",
".",
"breakableLine",
"(",
"line",
")",
")",
"{",
"boolean",
"changed",
"=",
"sourceInfo",
".",
"breakpoint",
"(",
"line",
",",
"true",
")",
";",
"if",
"(",
"chan... | Sets a breakpoint on the given line. | [
"Sets",
"a",
"breakpoint",
"on",
"the",
"given",
"line",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java#L2264-L2271 |
21,584 | mozilla/rhino | toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java | FileWindow.clearBreakPoint | public void clearBreakPoint(int line) {
if (sourceInfo.breakableLine(line)) {
boolean changed = sourceInfo.breakpoint(line, false);
if (changed) {
fileHeader.repaint();
}
}
} | java | public void clearBreakPoint(int line) {
if (sourceInfo.breakableLine(line)) {
boolean changed = sourceInfo.breakpoint(line, false);
if (changed) {
fileHeader.repaint();
}
}
} | [
"public",
"void",
"clearBreakPoint",
"(",
"int",
"line",
")",
"{",
"if",
"(",
"sourceInfo",
".",
"breakableLine",
"(",
"line",
")",
")",
"{",
"boolean",
"changed",
"=",
"sourceInfo",
".",
"breakpoint",
"(",
"line",
",",
"false",
")",
";",
"if",
"(",
"c... | Clears a breakpoint from the given line. | [
"Clears",
"a",
"breakpoint",
"from",
"the",
"given",
"line",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java#L2276-L2283 |
21,585 | mozilla/rhino | toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java | FileWindow.updateToolTip | private void updateToolTip() {
// Try to set tool tip on frame. On Mac OS X 10.5,
// the number of components is different, so try to be safe.
int n = getComponentCount() - 1;
if (n > 1) {
n = 1;
} else if (n < 0) {
return;
}
Component c = ... | java | private void updateToolTip() {
// Try to set tool tip on frame. On Mac OS X 10.5,
// the number of components is different, so try to be safe.
int n = getComponentCount() - 1;
if (n > 1) {
n = 1;
} else if (n < 0) {
return;
}
Component c = ... | [
"private",
"void",
"updateToolTip",
"(",
")",
"{",
"// Try to set tool tip on frame. On Mac OS X 10.5,",
"// the number of components is different, so try to be safe.",
"int",
"n",
"=",
"getComponentCount",
"(",
")",
"-",
"1",
";",
"if",
"(",
"n",
">",
"1",
")",
"{",
... | Updates the tool tip contents. | [
"Updates",
"the",
"tool",
"tip",
"contents",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java#L2311-L2325 |
21,586 | mozilla/rhino | toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java | FileWindow.updateText | public void updateText(Dim.SourceInfo sourceInfo) {
this.sourceInfo = sourceInfo;
String newText = sourceInfo.source();
if (!textArea.getText().equals(newText)) {
textArea.setText(newText);
int pos = 0;
if (currentPos != -1) {
pos = currentPos;... | java | public void updateText(Dim.SourceInfo sourceInfo) {
this.sourceInfo = sourceInfo;
String newText = sourceInfo.source();
if (!textArea.getText().equals(newText)) {
textArea.setText(newText);
int pos = 0;
if (currentPos != -1) {
pos = currentPos;... | [
"public",
"void",
"updateText",
"(",
"Dim",
".",
"SourceInfo",
"sourceInfo",
")",
"{",
"this",
".",
"sourceInfo",
"=",
"sourceInfo",
";",
"String",
"newText",
"=",
"sourceInfo",
".",
"source",
"(",
")",
";",
"if",
"(",
"!",
"textArea",
".",
"getText",
"(... | Called when the text of the script has changed. | [
"Called",
"when",
"the",
"text",
"of",
"the",
"script",
"has",
"changed",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java#L2337-L2350 |
21,587 | mozilla/rhino | toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java | FileWindow.select | public void select(int start, int end) {
int docEnd = textArea.getDocument().getLength();
textArea.select(docEnd, docEnd);
textArea.select(start, end);
} | java | public void select(int start, int end) {
int docEnd = textArea.getDocument().getLength();
textArea.select(docEnd, docEnd);
textArea.select(start, end);
} | [
"public",
"void",
"select",
"(",
"int",
"start",
",",
"int",
"end",
")",
"{",
"int",
"docEnd",
"=",
"textArea",
".",
"getDocument",
"(",
")",
".",
"getLength",
"(",
")",
";",
"textArea",
".",
"select",
"(",
"docEnd",
",",
"docEnd",
")",
";",
"textAre... | Selects a range of characters. | [
"Selects",
"a",
"range",
"of",
"characters",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java#L2364-L2368 |
21,588 | mozilla/rhino | toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java | MyTableModel.getValueAt | @Override
public Object getValueAt(int row, int column) {
switch (column) {
case 0:
return expressions.get(row);
case 1:
return values.get(row);
}
return "";
} | java | @Override
public Object getValueAt(int row, int column) {
switch (column) {
case 0:
return expressions.get(row);
case 1:
return values.get(row);
}
return "";
} | [
"@",
"Override",
"public",
"Object",
"getValueAt",
"(",
"int",
"row",
",",
"int",
"column",
")",
"{",
"switch",
"(",
"column",
")",
"{",
"case",
"0",
":",
"return",
"expressions",
".",
"get",
"(",
"row",
")",
";",
"case",
"1",
":",
"return",
"values"... | Returns the value in the given cell. | [
"Returns",
"the",
"value",
"in",
"the",
"given",
"cell",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java#L2474-L2483 |
21,589 | mozilla/rhino | toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java | MyTableModel.setValueAt | @Override
public void setValueAt(Object value, int row, int column) {
switch (column) {
case 0:
String expr = value.toString();
expressions.set(row, expr);
String result = "";
if (expr.length() > 0) {
result = debugGui.dim.eval(expr);
... | java | @Override
public void setValueAt(Object value, int row, int column) {
switch (column) {
case 0:
String expr = value.toString();
expressions.set(row, expr);
String result = "";
if (expr.length() > 0) {
result = debugGui.dim.eval(expr);
... | [
"@",
"Override",
"public",
"void",
"setValueAt",
"(",
"Object",
"value",
",",
"int",
"row",
",",
"int",
"column",
")",
"{",
"switch",
"(",
"column",
")",
"{",
"case",
"0",
":",
"String",
"expr",
"=",
"value",
".",
"toString",
"(",
")",
";",
"expressi... | Sets the value in the given cell. | [
"Sets",
"the",
"value",
"in",
"the",
"given",
"cell",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java#L2488-L2511 |
21,590 | mozilla/rhino | toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java | MyTableModel.updateModel | void updateModel() {
for (int i = 0; i < expressions.size(); ++i) {
String expr = expressions.get(i);
String result = "";
if (expr.length() > 0) {
result = debugGui.dim.eval(expr);
if (result == null) result = "";
} else {
... | java | void updateModel() {
for (int i = 0; i < expressions.size(); ++i) {
String expr = expressions.get(i);
String result = "";
if (expr.length() > 0) {
result = debugGui.dim.eval(expr);
if (result == null) result = "";
} else {
... | [
"void",
"updateModel",
"(",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"expressions",
".",
"size",
"(",
")",
";",
"++",
"i",
")",
"{",
"String",
"expr",
"=",
"expressions",
".",
"get",
"(",
"i",
")",
";",
"String",
"result",
"="... | Re-evaluates the expressions in the table. | [
"Re",
"-",
"evaluates",
"the",
"expressions",
"in",
"the",
"table",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java#L2516-L2530 |
21,591 | mozilla/rhino | toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java | VariableModel.getChildCount | @Override
public int getChildCount(Object nodeObj) {
if (debugger == null) {
return 0;
}
VariableNode node = (VariableNode) nodeObj;
return children(node).length;
} | java | @Override
public int getChildCount(Object nodeObj) {
if (debugger == null) {
return 0;
}
VariableNode node = (VariableNode) nodeObj;
return children(node).length;
} | [
"@",
"Override",
"public",
"int",
"getChildCount",
"(",
"Object",
"nodeObj",
")",
"{",
"if",
"(",
"debugger",
"==",
"null",
")",
"{",
"return",
"0",
";",
"}",
"VariableNode",
"node",
"=",
"(",
"VariableNode",
")",
"nodeObj",
";",
"return",
"children",
"(... | Returns the number of children of the given node. | [
"Returns",
"the",
"number",
"of",
"children",
"of",
"the",
"given",
"node",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java#L2618-L2625 |
21,592 | mozilla/rhino | toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java | VariableModel.getChild | @Override
public Object getChild(Object nodeObj, int i) {
if (debugger == null) {
return null;
}
VariableNode node = (VariableNode) nodeObj;
return children(node)[i];
} | java | @Override
public Object getChild(Object nodeObj, int i) {
if (debugger == null) {
return null;
}
VariableNode node = (VariableNode) nodeObj;
return children(node)[i];
} | [
"@",
"Override",
"public",
"Object",
"getChild",
"(",
"Object",
"nodeObj",
",",
"int",
"i",
")",
"{",
"if",
"(",
"debugger",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"VariableNode",
"node",
"=",
"(",
"VariableNode",
")",
"nodeObj",
";",
"ret... | Returns a child of the given node. | [
"Returns",
"a",
"child",
"of",
"the",
"given",
"node",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java#L2630-L2637 |
21,593 | mozilla/rhino | toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java | VariableModel.isLeaf | @Override
public boolean isLeaf(Object nodeObj) {
if (debugger == null) {
return true;
}
VariableNode node = (VariableNode) nodeObj;
return children(node).length == 0;
} | java | @Override
public boolean isLeaf(Object nodeObj) {
if (debugger == null) {
return true;
}
VariableNode node = (VariableNode) nodeObj;
return children(node).length == 0;
} | [
"@",
"Override",
"public",
"boolean",
"isLeaf",
"(",
"Object",
"nodeObj",
")",
"{",
"if",
"(",
"debugger",
"==",
"null",
")",
"{",
"return",
"true",
";",
"}",
"VariableNode",
"node",
"=",
"(",
"VariableNode",
")",
"nodeObj",
";",
"return",
"children",
"(... | Returns whether the given node is a leaf node. | [
"Returns",
"whether",
"the",
"given",
"node",
"is",
"a",
"leaf",
"node",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java#L2642-L2649 |
21,594 | mozilla/rhino | toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java | VariableModel.getIndexOfChild | @Override
public int getIndexOfChild(Object parentObj, Object childObj) {
if (debugger == null) {
return -1;
}
VariableNode parent = (VariableNode) parentObj;
VariableNode child = (VariableNode) childObj;
VariableNode[] children = children(parent);
for (in... | java | @Override
public int getIndexOfChild(Object parentObj, Object childObj) {
if (debugger == null) {
return -1;
}
VariableNode parent = (VariableNode) parentObj;
VariableNode child = (VariableNode) childObj;
VariableNode[] children = children(parent);
for (in... | [
"@",
"Override",
"public",
"int",
"getIndexOfChild",
"(",
"Object",
"parentObj",
",",
"Object",
"childObj",
")",
"{",
"if",
"(",
"debugger",
"==",
"null",
")",
"{",
"return",
"-",
"1",
";",
"}",
"VariableNode",
"parent",
"=",
"(",
"VariableNode",
")",
"p... | Returns the index of a node under its parent. | [
"Returns",
"the",
"index",
"of",
"a",
"node",
"under",
"its",
"parent",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java#L2654-L2668 |
21,595 | mozilla/rhino | toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java | VariableModel.getValueAt | @Override
public Object getValueAt(Object nodeObj, int column) {
if (debugger == null) { return null; }
VariableNode node = (VariableNode)nodeObj;
switch (column) {
case 0: // Name
return node.toString();
case 1: // Value
String result;
try... | java | @Override
public Object getValueAt(Object nodeObj, int column) {
if (debugger == null) { return null; }
VariableNode node = (VariableNode)nodeObj;
switch (column) {
case 0: // Name
return node.toString();
case 1: // Value
String result;
try... | [
"@",
"Override",
"public",
"Object",
"getValueAt",
"(",
"Object",
"nodeObj",
",",
"int",
"column",
")",
"{",
"if",
"(",
"debugger",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"VariableNode",
"node",
"=",
"(",
"VariableNode",
")",
"nodeObj",
";",... | Returns the value at the given cell. | [
"Returns",
"the",
"value",
"at",
"the",
"given",
"cell",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java#L2728-L2754 |
21,596 | mozilla/rhino | toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java | VariableModel.children | private VariableNode[] children(VariableNode node) {
if (node.children != null) {
return node.children;
}
VariableNode[] children;
Object value = getValue(node);
Object[] ids = debugger.getObjectIds(value);
if (ids == null || ids.length == 0) {
c... | java | private VariableNode[] children(VariableNode node) {
if (node.children != null) {
return node.children;
}
VariableNode[] children;
Object value = getValue(node);
Object[] ids = debugger.getObjectIds(value);
if (ids == null || ids.length == 0) {
c... | [
"private",
"VariableNode",
"[",
"]",
"children",
"(",
"VariableNode",
"node",
")",
"{",
"if",
"(",
"node",
".",
"children",
"!=",
"null",
")",
"{",
"return",
"node",
".",
"children",
";",
"}",
"VariableNode",
"[",
"]",
"children",
";",
"Object",
"value",... | Returns an array of the children of the given node. | [
"Returns",
"an",
"array",
"of",
"the",
"children",
"of",
"the",
"given",
"node",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java#L2759-L2796 |
21,597 | mozilla/rhino | toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java | VariableModel.getValue | public Object getValue(VariableNode node) {
try {
return debugger.getObjectProperty(node.object, node.id);
} catch (Exception exc) {
return "undefined";
}
} | java | public Object getValue(VariableNode node) {
try {
return debugger.getObjectProperty(node.object, node.id);
} catch (Exception exc) {
return "undefined";
}
} | [
"public",
"Object",
"getValue",
"(",
"VariableNode",
"node",
")",
"{",
"try",
"{",
"return",
"debugger",
".",
"getObjectProperty",
"(",
"node",
".",
"object",
",",
"node",
".",
"id",
")",
";",
"}",
"catch",
"(",
"Exception",
"exc",
")",
"{",
"return",
... | Returns the value of the given node. | [
"Returns",
"the",
"value",
"of",
"the",
"given",
"node",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java#L2801-L2807 |
21,598 | mozilla/rhino | toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java | MyTreeTable.resetTree | public JTree resetTree(TreeTableModel treeTableModel) {
tree = new TreeTableCellRenderer(treeTableModel);
// Install a tableModel representing the visible rows in the tree.
super.setModel(new TreeTableModelAdapter(treeTableModel, tree));
// Force the JTable and JTree to share their row... | java | public JTree resetTree(TreeTableModel treeTableModel) {
tree = new TreeTableCellRenderer(treeTableModel);
// Install a tableModel representing the visible rows in the tree.
super.setModel(new TreeTableModelAdapter(treeTableModel, tree));
// Force the JTable and JTree to share their row... | [
"public",
"JTree",
"resetTree",
"(",
"TreeTableModel",
"treeTableModel",
")",
"{",
"tree",
"=",
"new",
"TreeTableCellRenderer",
"(",
"treeTableModel",
")",
";",
"// Install a tableModel representing the visible rows in the tree.",
"super",
".",
"setModel",
"(",
"new",
"Tr... | Initializes a tree for this tree table. | [
"Initializes",
"a",
"tree",
"for",
"this",
"tree",
"table",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java#L2869-L2899 |
21,599 | mozilla/rhino | toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java | ContextWindow.setEnabled | @Override
public void setEnabled(boolean enabled) {
context.setEnabled(enabled);
thisTable.setEnabled(enabled);
localsTable.setEnabled(enabled);
evaluator.setEnabled(enabled);
cmdLine.setEnabled(enabled);
} | java | @Override
public void setEnabled(boolean enabled) {
context.setEnabled(enabled);
thisTable.setEnabled(enabled);
localsTable.setEnabled(enabled);
evaluator.setEnabled(enabled);
cmdLine.setEnabled(enabled);
} | [
"@",
"Override",
"public",
"void",
"setEnabled",
"(",
"boolean",
"enabled",
")",
"{",
"context",
".",
"setEnabled",
"(",
"enabled",
")",
";",
"thisTable",
".",
"setEnabled",
"(",
"enabled",
")",
";",
"localsTable",
".",
"setEnabled",
"(",
"enabled",
")",
"... | Enables or disables the component. | [
"Enables",
"or",
"disables",
"the",
"component",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java#L3260-L3267 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.