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,300 | mozilla/rhino | src/org/mozilla/javascript/BaseFunction.java | BaseFunction.setImmunePrototypeProperty | public void setImmunePrototypeProperty(Object value)
{
if ((prototypePropertyAttributes & READONLY) != 0) {
throw new IllegalStateException();
}
prototypeProperty = (value != null) ? value : UniqueTag.NULL_VALUE;
prototypePropertyAttributes = DONTENUM | PERMANENT | READON... | java | public void setImmunePrototypeProperty(Object value)
{
if ((prototypePropertyAttributes & READONLY) != 0) {
throw new IllegalStateException();
}
prototypeProperty = (value != null) ? value : UniqueTag.NULL_VALUE;
prototypePropertyAttributes = DONTENUM | PERMANENT | READON... | [
"public",
"void",
"setImmunePrototypeProperty",
"(",
"Object",
"value",
")",
"{",
"if",
"(",
"(",
"prototypePropertyAttributes",
"&",
"READONLY",
")",
"!=",
"0",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
")",
";",
"}",
"prototypeProperty",
"=",
"... | Make value as DontEnum, DontDelete, ReadOnly
prototype property of this Function object | [
"Make",
"value",
"as",
"DontEnum",
"DontDelete",
"ReadOnly",
"prototype",
"property",
"of",
"this",
"Function",
"object"
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/BaseFunction.java#L328-L335 |
21,301 | mozilla/rhino | src/org/mozilla/javascript/BaseFunction.java | BaseFunction.call | @Override
public Object call(Context cx, Scriptable scope, Scriptable thisObj,
Object[] args)
{
return Undefined.instance;
} | java | @Override
public Object call(Context cx, Scriptable scope, Scriptable thisObj,
Object[] args)
{
return Undefined.instance;
} | [
"@",
"Override",
"public",
"Object",
"call",
"(",
"Context",
"cx",
",",
"Scriptable",
"scope",
",",
"Scriptable",
"thisObj",
",",
"Object",
"[",
"]",
"args",
")",
"{",
"return",
"Undefined",
".",
"instance",
";",
"}"
] | Should be overridden. | [
"Should",
"be",
"overridden",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/BaseFunction.java#L349-L354 |
21,302 | mozilla/rhino | src/org/mozilla/javascript/EqualObjectGraphs.java | EqualObjectGraphs.getSortedIds | private static Object[] getSortedIds(final Scriptable s) {
final Object[] ids = getIds(s);
Arrays.sort(ids, (a, b) -> {
if (a instanceof Integer) {
if (b instanceof Integer) {
return ((Integer)a).compareTo((Integer)b);
} else if (b instance... | java | private static Object[] getSortedIds(final Scriptable s) {
final Object[] ids = getIds(s);
Arrays.sort(ids, (a, b) -> {
if (a instanceof Integer) {
if (b instanceof Integer) {
return ((Integer)a).compareTo((Integer)b);
} else if (b instance... | [
"private",
"static",
"Object",
"[",
"]",
"getSortedIds",
"(",
"final",
"Scriptable",
"s",
")",
"{",
"final",
"Object",
"[",
"]",
"ids",
"=",
"getIds",
"(",
"s",
")",
";",
"Arrays",
".",
"sort",
"(",
"ids",
",",
"(",
"a",
",",
"b",
")",
"->",
"{",... | Sort IDs deterministically | [
"Sort",
"IDs",
"deterministically"
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/EqualObjectGraphs.java#L255-L286 |
21,303 | mozilla/rhino | src/org/mozilla/javascript/ObjToIntMap.java | ObjToIntMap.intern | public Object intern(Object keyArg) {
boolean nullKey = false;
if (keyArg == null) {
nullKey = true;
keyArg = UniqueTag.NULL_VALUE;
}
int index = ensureIndex(keyArg);
values[index] = 0;
return (nullKey) ? null : keys[index];
} | java | public Object intern(Object keyArg) {
boolean nullKey = false;
if (keyArg == null) {
nullKey = true;
keyArg = UniqueTag.NULL_VALUE;
}
int index = ensureIndex(keyArg);
values[index] = 0;
return (nullKey) ? null : keys[index];
} | [
"public",
"Object",
"intern",
"(",
"Object",
"keyArg",
")",
"{",
"boolean",
"nullKey",
"=",
"false",
";",
"if",
"(",
"keyArg",
"==",
"null",
")",
"{",
"nullKey",
"=",
"true",
";",
"keyArg",
"=",
"UniqueTag",
".",
"NULL_VALUE",
";",
"}",
"int",
"index",... | If table already contains a key that equals to keyArg, return that key
while setting its value to zero, otherwise add keyArg with 0 value to
the table and return it. | [
"If",
"table",
"already",
"contains",
"a",
"key",
"that",
"equals",
"to",
"keyArg",
"return",
"that",
"key",
"while",
"setting",
"its",
"value",
"to",
"zero",
"otherwise",
"add",
"keyArg",
"with",
"0",
"value",
"to",
"the",
"table",
"and",
"return",
"it",
... | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ObjToIntMap.java#L159-L168 |
21,304 | mozilla/rhino | src/org/mozilla/javascript/ast/IfStatement.java | IfStatement.visit | @Override
public void visit(NodeVisitor v) {
if (v.visit(this)) {
condition.visit(v);
thenPart.visit(v);
if (elsePart != null) {
elsePart.visit(v);
}
}
} | java | @Override
public void visit(NodeVisitor v) {
if (v.visit(this)) {
condition.visit(v);
thenPart.visit(v);
if (elsePart != null) {
elsePart.visit(v);
}
}
} | [
"@",
"Override",
"public",
"void",
"visit",
"(",
"NodeVisitor",
"v",
")",
"{",
"if",
"(",
"v",
".",
"visit",
"(",
"this",
")",
")",
"{",
"condition",
".",
"visit",
"(",
"v",
")",
";",
"thenPart",
".",
"visit",
"(",
"v",
")",
";",
"if",
"(",
"el... | Visits this node, the condition, the then-part, and
if supplied, the else-part. | [
"Visits",
"this",
"node",
"the",
"condition",
"the",
"then",
"-",
"part",
"and",
"if",
"supplied",
"the",
"else",
"-",
"part",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ast/IfStatement.java#L189-L198 |
21,305 | mozilla/rhino | src/org/mozilla/javascript/WrapFactory.java | WrapFactory.wrapNewObject | public Scriptable wrapNewObject(Context cx, Scriptable scope, Object obj)
{
if (obj instanceof Scriptable) {
return (Scriptable)obj;
}
Class<?> cls = obj.getClass();
if (cls.isArray()) {
return NativeJavaArray.wrap(scope, obj);
}
return wrapAsJ... | java | public Scriptable wrapNewObject(Context cx, Scriptable scope, Object obj)
{
if (obj instanceof Scriptable) {
return (Scriptable)obj;
}
Class<?> cls = obj.getClass();
if (cls.isArray()) {
return NativeJavaArray.wrap(scope, obj);
}
return wrapAsJ... | [
"public",
"Scriptable",
"wrapNewObject",
"(",
"Context",
"cx",
",",
"Scriptable",
"scope",
",",
"Object",
"obj",
")",
"{",
"if",
"(",
"obj",
"instanceof",
"Scriptable",
")",
"{",
"return",
"(",
"Scriptable",
")",
"obj",
";",
"}",
"Class",
"<",
"?",
">",
... | Wrap an object newly created by a constructor call.
@param cx the current Context for this thread
@param scope the scope of the executing script
@param obj the object to be wrapped
@return the wrapped value. | [
"Wrap",
"an",
"object",
"newly",
"created",
"by",
"a",
"constructor",
"call",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/WrapFactory.java#L87-L97 |
21,306 | mozilla/rhino | src/org/mozilla/javascript/ast/Loop.java | Loop.setBody | public void setBody(AstNode body) {
this.body = body;
int end = body.getPosition() + body.getLength();
this.setLength(end - this.getPosition());
body.setParent(this);
} | java | public void setBody(AstNode body) {
this.body = body;
int end = body.getPosition() + body.getLength();
this.setLength(end - this.getPosition());
body.setParent(this);
} | [
"public",
"void",
"setBody",
"(",
"AstNode",
"body",
")",
"{",
"this",
".",
"body",
"=",
"body",
";",
"int",
"end",
"=",
"body",
".",
"getPosition",
"(",
")",
"+",
"body",
".",
"getLength",
"(",
")",
";",
"this",
".",
"setLength",
"(",
"end",
"-",
... | Sets loop body. Sets the parent of the body to this loop node,
and updates its offset to be relative. Extends the length of this
node to include the body. | [
"Sets",
"loop",
"body",
".",
"Sets",
"the",
"parent",
"of",
"the",
"body",
"to",
"this",
"loop",
"node",
"and",
"updates",
"its",
"offset",
"to",
"be",
"relative",
".",
"Extends",
"the",
"length",
"of",
"this",
"node",
"to",
"include",
"the",
"body",
"... | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ast/Loop.java#L41-L46 |
21,307 | mozilla/rhino | src/org/mozilla/javascript/NativeContinuation.java | NativeContinuation.equalImplementations | public static boolean equalImplementations(NativeContinuation c1, NativeContinuation c2) {
return Objects.equals(c1.implementation, c2.implementation);
} | java | public static boolean equalImplementations(NativeContinuation c1, NativeContinuation c2) {
return Objects.equals(c1.implementation, c2.implementation);
} | [
"public",
"static",
"boolean",
"equalImplementations",
"(",
"NativeContinuation",
"c1",
",",
"NativeContinuation",
"c2",
")",
"{",
"return",
"Objects",
".",
"equals",
"(",
"c1",
".",
"implementation",
",",
"c2",
".",
"implementation",
")",
";",
"}"
] | Returns true if both continuations have equal implementations.
@param c1 one continuation
@param c2 another continuation
@return true if the implementations of both continuations are equal, or they are both null.
@throws NullPointerException if either continuation is null | [
"Returns",
"true",
"if",
"both",
"continuations",
"have",
"equal",
"implementations",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/NativeContinuation.java#L70-L72 |
21,308 | mozilla/rhino | src/org/mozilla/javascript/NativeJavaPackage.java | NativeJavaPackage.forcePackage | NativeJavaPackage forcePackage(String name, Scriptable scope)
{
Object cached = super.get(name, this);
if (cached != null && cached instanceof NativeJavaPackage) {
return (NativeJavaPackage) cached;
}
String newPackage = packageName.length() == 0
... | java | NativeJavaPackage forcePackage(String name, Scriptable scope)
{
Object cached = super.get(name, this);
if (cached != null && cached instanceof NativeJavaPackage) {
return (NativeJavaPackage) cached;
}
String newPackage = packageName.length() == 0
... | [
"NativeJavaPackage",
"forcePackage",
"(",
"String",
"name",
",",
"Scriptable",
"scope",
")",
"{",
"Object",
"cached",
"=",
"super",
".",
"get",
"(",
"name",
",",
"this",
")",
";",
"if",
"(",
"cached",
"!=",
"null",
"&&",
"cached",
"instanceof",
"NativeJava... | need to look for a class by that name | [
"need",
"to",
"look",
"for",
"a",
"class",
"by",
"that",
"name"
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/NativeJavaPackage.java#L94-L107 |
21,309 | mozilla/rhino | examples/Matrix.java | Matrix.hasInstance | @Override
public boolean hasInstance(Scriptable value) {
Scriptable proto = value.getPrototype();
while (proto != null) {
if (proto.equals(this))
return true;
proto = proto.getPrototype();
}
return false;
} | java | @Override
public boolean hasInstance(Scriptable value) {
Scriptable proto = value.getPrototype();
while (proto != null) {
if (proto.equals(this))
return true;
proto = proto.getPrototype();
}
return false;
} | [
"@",
"Override",
"public",
"boolean",
"hasInstance",
"(",
"Scriptable",
"value",
")",
"{",
"Scriptable",
"proto",
"=",
"value",
".",
"getPrototype",
"(",
")",
";",
"while",
"(",
"proto",
"!=",
"null",
")",
"{",
"if",
"(",
"proto",
".",
"equals",
"(",
"... | instanceof operator.
We mimick the normal JavaScript instanceof semantics, returning
true if <code>this</code> appears in <code>value</code>'s prototype
chain. | [
"instanceof",
"operator",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/examples/Matrix.java#L261-L271 |
21,310 | mozilla/rhino | xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLName.java | XMLName.accept | static boolean accept(Object nameObj) {
String name;
try {
name = ScriptRuntime.toString(nameObj);
} catch (EcmaError ee) {
if ("TypeError".equals(ee.getName())) {
return false;
}
throw ee;
}
// See http://w3.org/TR... | java | static boolean accept(Object nameObj) {
String name;
try {
name = ScriptRuntime.toString(nameObj);
} catch (EcmaError ee) {
if ("TypeError".equals(ee.getName())) {
return false;
}
throw ee;
}
// See http://w3.org/TR... | [
"static",
"boolean",
"accept",
"(",
"Object",
"nameObj",
")",
"{",
"String",
"name",
";",
"try",
"{",
"name",
"=",
"ScriptRuntime",
".",
"toString",
"(",
"nameObj",
")",
";",
"}",
"catch",
"(",
"EcmaError",
"ee",
")",
"{",
"if",
"(",
"\"TypeError\"",
"... | See ECMA357 13.1.2.1 | [
"See",
"ECMA357",
"13",
".",
"1",
".",
"2",
".",
"1"
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLName.java#L70-L95 |
21,311 | mozilla/rhino | src/org/mozilla/javascript/NativeSet.java | NativeSet.loadFromIterable | static void loadFromIterable(Context cx, Scriptable scope, ScriptableObject set, Object arg1)
{
if ((arg1 == null) || Undefined.instance.equals(arg1)) {
return;
}
// Call the "[Symbol.iterator]" property as a function.
Object ito = ScriptRuntime.callIterator(arg1, cx, sc... | java | static void loadFromIterable(Context cx, Scriptable scope, ScriptableObject set, Object arg1)
{
if ((arg1 == null) || Undefined.instance.equals(arg1)) {
return;
}
// Call the "[Symbol.iterator]" property as a function.
Object ito = ScriptRuntime.callIterator(arg1, cx, sc... | [
"static",
"void",
"loadFromIterable",
"(",
"Context",
"cx",
",",
"Scriptable",
"scope",
",",
"ScriptableObject",
"set",
",",
"Object",
"arg1",
")",
"{",
"if",
"(",
"(",
"arg1",
"==",
"null",
")",
"||",
"Undefined",
".",
"instance",
".",
"equals",
"(",
"a... | If an "iterable" object was passed to the constructor, there are many many things
to do. This is common code with NativeWeakSet. | [
"If",
"an",
"iterable",
"object",
"was",
"passed",
"to",
"the",
"constructor",
"there",
"are",
"many",
"many",
"things",
"to",
"do",
".",
"This",
"is",
"common",
"code",
"with",
"NativeWeakSet",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/NativeSet.java#L155-L184 |
21,312 | mozilla/rhino | src/org/mozilla/javascript/ast/KeywordLiteral.java | KeywordLiteral.setType | @Override
public KeywordLiteral setType(int nodeType) {
if (!(nodeType == Token.THIS
|| nodeType == Token.NULL
|| nodeType == Token.TRUE
|| nodeType == Token.FALSE
|| nodeType == Token.DEBUGGER))
throw new IllegalArgumentException("Invalid ... | java | @Override
public KeywordLiteral setType(int nodeType) {
if (!(nodeType == Token.THIS
|| nodeType == Token.NULL
|| nodeType == Token.TRUE
|| nodeType == Token.FALSE
|| nodeType == Token.DEBUGGER))
throw new IllegalArgumentException("Invalid ... | [
"@",
"Override",
"public",
"KeywordLiteral",
"setType",
"(",
"int",
"nodeType",
")",
"{",
"if",
"(",
"!",
"(",
"nodeType",
"==",
"Token",
".",
"THIS",
"||",
"nodeType",
"==",
"Token",
".",
"NULL",
"||",
"nodeType",
"==",
"Token",
".",
"TRUE",
"||",
"no... | Sets node token type
@throws IllegalArgumentException if {@code nodeType} is unsupported | [
"Sets",
"node",
"token",
"type"
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ast/KeywordLiteral.java#L47-L58 |
21,313 | mozilla/rhino | src/org/mozilla/javascript/Kit.java | Kit.classOrNull | public static Class<?> classOrNull(ClassLoader loader, String className)
{
try {
return loader.loadClass(className);
} catch (ClassNotFoundException ex) {
} catch (SecurityException ex) {
} catch (LinkageError ex) {
} catch (IllegalArgumentException e) {
... | java | public static Class<?> classOrNull(ClassLoader loader, String className)
{
try {
return loader.loadClass(className);
} catch (ClassNotFoundException ex) {
} catch (SecurityException ex) {
} catch (LinkageError ex) {
} catch (IllegalArgumentException e) {
... | [
"public",
"static",
"Class",
"<",
"?",
">",
"classOrNull",
"(",
"ClassLoader",
"loader",
",",
"String",
"className",
")",
"{",
"try",
"{",
"return",
"loader",
".",
"loadClass",
"(",
"className",
")",
";",
"}",
"catch",
"(",
"ClassNotFoundException",
"ex",
... | Attempt to load the class of the given name. Note that the type parameter
isn't checked. | [
"Attempt",
"to",
"load",
"the",
"class",
"of",
"the",
"given",
"name",
".",
"Note",
"that",
"the",
"type",
"parameter",
"isn",
"t",
"checked",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/Kit.java#L57-L69 |
21,314 | mozilla/rhino | xmlimplsrc/org/mozilla/javascript/xmlimpl/XML.java | XML.getExtraMethodSource | @Override
public Scriptable getExtraMethodSource(Context cx) {
if (hasSimpleContent()) {
String src = toString();
return ScriptRuntime.toObjectOrNull(cx, src);
}
return null;
} | java | @Override
public Scriptable getExtraMethodSource(Context cx) {
if (hasSimpleContent()) {
String src = toString();
return ScriptRuntime.toObjectOrNull(cx, src);
}
return null;
} | [
"@",
"Override",
"public",
"Scriptable",
"getExtraMethodSource",
"(",
"Context",
"cx",
")",
"{",
"if",
"(",
"hasSimpleContent",
"(",
")",
")",
"{",
"String",
"src",
"=",
"toString",
"(",
")",
";",
"return",
"ScriptRuntime",
".",
"toObjectOrNull",
"(",
"cx",
... | See ECMA 357, 11_2_2_1, Semantics, 3_f. | [
"See",
"ECMA",
"357",
"11_2_2_1",
"Semantics",
"3_f",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/xmlimplsrc/org/mozilla/javascript/xmlimpl/XML.java#L198-L205 |
21,315 | mozilla/rhino | src/org/mozilla/javascript/v8dtoa/DoubleHelper.java | DoubleHelper.normalizedBoundaries | static void normalizedBoundaries(long d64, DiyFp m_minus, DiyFp m_plus) {
DiyFp v = asDiyFp(d64);
boolean significand_is_zero = (v.f() == kHiddenBit);
m_plus.setF((v.f() << 1) + 1);
m_plus.setE(v.e() - 1);
m_plus.normalize();
if (significand_is_zero && v.e() != kDenormalE... | java | static void normalizedBoundaries(long d64, DiyFp m_minus, DiyFp m_plus) {
DiyFp v = asDiyFp(d64);
boolean significand_is_zero = (v.f() == kHiddenBit);
m_plus.setF((v.f() << 1) + 1);
m_plus.setE(v.e() - 1);
m_plus.normalize();
if (significand_is_zero && v.e() != kDenormalE... | [
"static",
"void",
"normalizedBoundaries",
"(",
"long",
"d64",
",",
"DiyFp",
"m_minus",
",",
"DiyFp",
"m_plus",
")",
"{",
"DiyFp",
"v",
"=",
"asDiyFp",
"(",
"d64",
")",
";",
"boolean",
"significand_is_zero",
"=",
"(",
"v",
".",
"f",
"(",
")",
"==",
"kHi... | exponent as m_plus. | [
"exponent",
"as",
"m_plus",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/v8dtoa/DoubleHelper.java#L110-L131 |
21,316 | mozilla/rhino | src/org/mozilla/javascript/ContextFactory.java | ContextFactory.initGlobal | public synchronized static void initGlobal(ContextFactory factory)
{
if (factory == null) {
throw new IllegalArgumentException();
}
if (hasCustomGlobal) {
throw new IllegalStateException();
}
hasCustomGlobal = true;
global = factory;
} | java | public synchronized static void initGlobal(ContextFactory factory)
{
if (factory == null) {
throw new IllegalArgumentException();
}
if (hasCustomGlobal) {
throw new IllegalStateException();
}
hasCustomGlobal = true;
global = factory;
} | [
"public",
"synchronized",
"static",
"void",
"initGlobal",
"(",
"ContextFactory",
"factory",
")",
"{",
"if",
"(",
"factory",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
")",
";",
"}",
"if",
"(",
"hasCustomGlobal",
")",
"{",
"throw... | Set global ContextFactory.
The method can only be called once.
@see #getGlobal()
@see #hasExplicitGlobal() | [
"Set",
"global",
"ContextFactory",
".",
"The",
"method",
"can",
"only",
"be",
"called",
"once",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ContextFactory.java#L170-L180 |
21,317 | mozilla/rhino | src/org/mozilla/javascript/ContextFactory.java | ContextFactory.initApplicationClassLoader | public final void initApplicationClassLoader(ClassLoader loader)
{
if (loader == null)
throw new IllegalArgumentException("loader is null");
if (!Kit.testIfCanLoadRhinoClasses(loader))
throw new IllegalArgumentException(
"Loader can not resolve Rhino classes")... | java | public final void initApplicationClassLoader(ClassLoader loader)
{
if (loader == null)
throw new IllegalArgumentException("loader is null");
if (!Kit.testIfCanLoadRhinoClasses(loader))
throw new IllegalArgumentException(
"Loader can not resolve Rhino classes")... | [
"public",
"final",
"void",
"initApplicationClassLoader",
"(",
"ClassLoader",
"loader",
")",
"{",
"if",
"(",
"loader",
"==",
"null",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"loader is null\"",
")",
";",
"if",
"(",
"!",
"Kit",
".",
"testIfCanLoadRh... | Set explicit class loader to use when searching for Java classes.
@see #getApplicationClassLoader() | [
"Set",
"explicit",
"class",
"loader",
"to",
"use",
"when",
"searching",
"for",
"Java",
"classes",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ContextFactory.java#L382-L396 |
21,318 | mozilla/rhino | src/org/mozilla/javascript/ContextFactory.java | ContextFactory.doTopCall | protected Object doTopCall(Callable callable,
Context cx, Scriptable scope,
Scriptable thisObj, Object[] args)
{
Object result = callable.call(cx, scope, thisObj, args);
return result instanceof ConsString ? result.toString() : result;
... | java | protected Object doTopCall(Callable callable,
Context cx, Scriptable scope,
Scriptable thisObj, Object[] args)
{
Object result = callable.call(cx, scope, thisObj, args);
return result instanceof ConsString ? result.toString() : result;
... | [
"protected",
"Object",
"doTopCall",
"(",
"Callable",
"callable",
",",
"Context",
"cx",
",",
"Scriptable",
"scope",
",",
"Scriptable",
"thisObj",
",",
"Object",
"[",
"]",
"args",
")",
"{",
"Object",
"result",
"=",
"callable",
".",
"call",
"(",
"cx",
",",
... | Execute top call to script or function.
When the runtime is about to execute a script or function that will
create the first stack frame with scriptable code, it calls this method
to perform the real call. In this way execution of any script
happens inside this function. | [
"Execute",
"top",
"call",
"to",
"script",
"or",
"function",
".",
"When",
"the",
"runtime",
"is",
"about",
"to",
"execute",
"a",
"script",
"or",
"function",
"that",
"will",
"create",
"the",
"first",
"stack",
"frame",
"with",
"scriptable",
"code",
"it",
"cal... | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ContextFactory.java#L405-L411 |
21,319 | mozilla/rhino | src/org/mozilla/javascript/EmbeddedSlotMap.java | EmbeddedSlotMap.query | @Override
public ScriptableObject.Slot query(Object key, int index)
{
if (slots == null) {
return null;
}
final int indexOrHash = (key != null ? key.hashCode() : index);
final int slotIndex = getSlotIndex(slots.length, indexOrHash);
for (ScriptableObject.Slot... | java | @Override
public ScriptableObject.Slot query(Object key, int index)
{
if (slots == null) {
return null;
}
final int indexOrHash = (key != null ? key.hashCode() : index);
final int slotIndex = getSlotIndex(slots.length, indexOrHash);
for (ScriptableObject.Slot... | [
"@",
"Override",
"public",
"ScriptableObject",
".",
"Slot",
"query",
"(",
"Object",
"key",
",",
"int",
"index",
")",
"{",
"if",
"(",
"slots",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"final",
"int",
"indexOrHash",
"=",
"(",
"key",
"!=",
"n... | Locate the slot with the given name or index. | [
"Locate",
"the",
"slot",
"with",
"the",
"given",
"name",
"or",
"index",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/EmbeddedSlotMap.java#L78-L98 |
21,320 | mozilla/rhino | src/org/mozilla/javascript/EmbeddedSlotMap.java | EmbeddedSlotMap.get | @Override
public ScriptableObject.Slot get(Object key, int index, ScriptableObject.SlotAccess accessType)
{
if (slots == null && accessType == SlotAccess.QUERY) {
return null;
}
final int indexOrHash = (key != null ? key.hashCode() : index);
ScriptableObject.Slot slo... | java | @Override
public ScriptableObject.Slot get(Object key, int index, ScriptableObject.SlotAccess accessType)
{
if (slots == null && accessType == SlotAccess.QUERY) {
return null;
}
final int indexOrHash = (key != null ? key.hashCode() : index);
ScriptableObject.Slot slo... | [
"@",
"Override",
"public",
"ScriptableObject",
".",
"Slot",
"get",
"(",
"Object",
"key",
",",
"int",
"index",
",",
"ScriptableObject",
".",
"SlotAccess",
"accessType",
")",
"{",
"if",
"(",
"slots",
"==",
"null",
"&&",
"accessType",
"==",
"SlotAccess",
".",
... | Locate the slot with given name or index. Depending on the accessType
parameter and the current slot status, a new slot may be allocated.
@param key either a String or a Symbol object that identifies the property
@param index index or 0 if slot holds property name. | [
"Locate",
"the",
"slot",
"with",
"given",
"name",
"or",
"index",
".",
"Depending",
"on",
"the",
"accessType",
"parameter",
"and",
"the",
"current",
"slot",
"status",
"a",
"new",
"slot",
"may",
"be",
"allocated",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/EmbeddedSlotMap.java#L107-L154 |
21,321 | mozilla/rhino | src/org/mozilla/javascript/EmbeddedSlotMap.java | EmbeddedSlotMap.addKnownAbsentSlot | private void addKnownAbsentSlot(ScriptableObject.Slot[] addSlots, ScriptableObject.Slot slot)
{
final int insertPos = getSlotIndex(addSlots.length, slot.indexOrHash);
ScriptableObject.Slot old = addSlots[insertPos];
addSlots[insertPos] = slot;
slot.next = old;
} | java | private void addKnownAbsentSlot(ScriptableObject.Slot[] addSlots, ScriptableObject.Slot slot)
{
final int insertPos = getSlotIndex(addSlots.length, slot.indexOrHash);
ScriptableObject.Slot old = addSlots[insertPos];
addSlots[insertPos] = slot;
slot.next = old;
} | [
"private",
"void",
"addKnownAbsentSlot",
"(",
"ScriptableObject",
".",
"Slot",
"[",
"]",
"addSlots",
",",
"ScriptableObject",
".",
"Slot",
"slot",
")",
"{",
"final",
"int",
"insertPos",
"=",
"getSlotIndex",
"(",
"addSlots",
".",
"length",
",",
"slot",
".",
"... | Add slot with keys that are known to absent from the table.
This is an optimization to use when inserting into empty table,
after table growth or during deserialization. | [
"Add",
"slot",
"with",
"keys",
"that",
"are",
"known",
"to",
"absent",
"from",
"the",
"table",
".",
"This",
"is",
"an",
"optimization",
"to",
"use",
"when",
"inserting",
"into",
"empty",
"table",
"after",
"table",
"growth",
"or",
"during",
"deserialization",... | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/EmbeddedSlotMap.java#L343-L349 |
21,322 | mozilla/rhino | src/org/mozilla/classfile/SuperBlock.java | SuperBlock.getTrimmedLocals | int[] getTrimmedLocals() {
int last = locals.length - 1;
// Exclude all of the trailing TOPs not bound to a DOUBLE/LONG
while (last >= 0 && locals[last] == TypeInfo.TOP &&
!TypeInfo.isTwoWords(locals[last - 1])) {
last--;
}
last++;
// Exclude trailing TOPs following a DOUBLE/LONG
... | java | int[] getTrimmedLocals() {
int last = locals.length - 1;
// Exclude all of the trailing TOPs not bound to a DOUBLE/LONG
while (last >= 0 && locals[last] == TypeInfo.TOP &&
!TypeInfo.isTwoWords(locals[last - 1])) {
last--;
}
last++;
// Exclude trailing TOPs following a DOUBLE/LONG
... | [
"int",
"[",
"]",
"getTrimmedLocals",
"(",
")",
"{",
"int",
"last",
"=",
"locals",
".",
"length",
"-",
"1",
";",
"// Exclude all of the trailing TOPs not bound to a DOUBLE/LONG",
"while",
"(",
"last",
">=",
"0",
"&&",
"locals",
"[",
"last",
"]",
"==",
"TypeInfo... | Get a copy of the super block's locals without any trailing TOP types.
This is useful for actual writing stack maps; during the computation of
stack map types, all local arrays have the same size; the max locals for
the method. In addition, DOUBLE and LONG types have trailing TOP types
because they occupy two words. F... | [
"Get",
"a",
"copy",
"of",
"the",
"super",
"block",
"s",
"locals",
"without",
"any",
"trailing",
"TOP",
"types",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/classfile/SuperBlock.java#L47-L70 |
21,323 | mozilla/rhino | src/org/mozilla/classfile/SuperBlock.java | SuperBlock.mergeState | private boolean mergeState(int[] current, int[] incoming, int size,
ConstantPool pool) {
boolean changed = false;
for (int i = 0; i < size; i++) {
int currentType = current[i];
current[i] = TypeInfo.merge(current[i], incoming[i], pool);
if (currentType != current[i]) {
changed =... | java | private boolean mergeState(int[] current, int[] incoming, int size,
ConstantPool pool) {
boolean changed = false;
for (int i = 0; i < size; i++) {
int currentType = current[i];
current[i] = TypeInfo.merge(current[i], incoming[i], pool);
if (currentType != current[i]) {
changed =... | [
"private",
"boolean",
"mergeState",
"(",
"int",
"[",
"]",
"current",
",",
"int",
"[",
"]",
"incoming",
",",
"int",
"size",
",",
"ConstantPool",
"pool",
")",
"{",
"boolean",
"changed",
"=",
"false",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"... | Merge an operand stack or local variable array with incoming state.
They are treated the same way; by this point, it should already be
ensured that the array sizes are the same, which is the only additional
constraint that is imposed on merging operand stacks (the local variable
array is always the same size). | [
"Merge",
"an",
"operand",
"stack",
"or",
"local",
"variable",
"array",
"with",
"incoming",
"state",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/classfile/SuperBlock.java#L113-L125 |
21,324 | mozilla/rhino | xmlimplsrc/org/mozilla/javascript/xmlimpl/XmlProcessor.java | XmlProcessor.getDocumentBuilderFromPool | private DocumentBuilder getDocumentBuilderFromPool()
throws ParserConfigurationException {
DocumentBuilder builder = documentBuilderPool.pollFirst();
if (builder == null){
builder = getDomFactory().newDocumentBuilder();
}
builder.setErrorHandler(errorHandler);
... | java | private DocumentBuilder getDocumentBuilderFromPool()
throws ParserConfigurationException {
DocumentBuilder builder = documentBuilderPool.pollFirst();
if (builder == null){
builder = getDomFactory().newDocumentBuilder();
}
builder.setErrorHandler(errorHandler);
... | [
"private",
"DocumentBuilder",
"getDocumentBuilderFromPool",
"(",
")",
"throws",
"ParserConfigurationException",
"{",
"DocumentBuilder",
"builder",
"=",
"documentBuilderPool",
".",
"pollFirst",
"(",
")",
";",
"if",
"(",
"builder",
"==",
"null",
")",
"{",
"builder",
"... | Get from pool, or create one without locking, if needed. | [
"Get",
"from",
"pool",
"or",
"create",
"one",
"without",
"locking",
"if",
"needed",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/xmlimplsrc/org/mozilla/javascript/xmlimpl/XmlProcessor.java#L158-L166 |
21,325 | mozilla/rhino | src/org/mozilla/javascript/ast/GeneratorExpressionLoop.java | GeneratorExpressionLoop.visit | @Override
public void visit(NodeVisitor v) {
if (v.visit(this)) {
iterator.visit(v);
iteratedObject.visit(v);
}
} | java | @Override
public void visit(NodeVisitor v) {
if (v.visit(this)) {
iterator.visit(v);
iteratedObject.visit(v);
}
} | [
"@",
"Override",
"public",
"void",
"visit",
"(",
"NodeVisitor",
"v",
")",
"{",
"if",
"(",
"v",
".",
"visit",
"(",
"this",
")",
")",
"{",
"iterator",
".",
"visit",
"(",
"v",
")",
";",
"iteratedObject",
".",
"visit",
"(",
"v",
")",
";",
"}",
"}"
] | Visits the iterator expression and the iterated object expression.
There is no body-expression for this loop type. | [
"Visits",
"the",
"iterator",
"expression",
"and",
"the",
"iterated",
"object",
"expression",
".",
"There",
"is",
"no",
"body",
"-",
"expression",
"for",
"this",
"loop",
"type",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ast/GeneratorExpressionLoop.java#L56-L62 |
21,326 | mozilla/rhino | src/org/mozilla/javascript/DToA.java | DToA.pow5mult | static BigInteger pow5mult(BigInteger b, int k)
{
return b.multiply(BigInteger.valueOf(5).pow(k));
} | java | static BigInteger pow5mult(BigInteger b, int k)
{
return b.multiply(BigInteger.valueOf(5).pow(k));
} | [
"static",
"BigInteger",
"pow5mult",
"(",
"BigInteger",
"b",
",",
"int",
"k",
")",
"{",
"return",
"b",
".",
"multiply",
"(",
"BigInteger",
".",
"valueOf",
"(",
"5",
")",
".",
"pow",
"(",
"k",
")",
")",
";",
"}"
] | XXXX the C version built a cache of these | [
"XXXX",
"the",
"C",
"version",
"built",
"a",
"cache",
"of",
"these"
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/DToA.java#L413-L416 |
21,327 | mozilla/rhino | src/org/mozilla/javascript/ScriptableObject.java | ScriptableObject.has | @Override
public boolean has(Symbol key, Scriptable start)
{
return null != slotMap.query(key, 0);
} | java | @Override
public boolean has(Symbol key, Scriptable start)
{
return null != slotMap.query(key, 0);
} | [
"@",
"Override",
"public",
"boolean",
"has",
"(",
"Symbol",
"key",
",",
"Scriptable",
"start",
")",
"{",
"return",
"null",
"!=",
"slotMap",
".",
"query",
"(",
"key",
",",
"0",
")",
";",
"}"
] | A version of "has" that supports symbols. | [
"A",
"version",
"of",
"has",
"that",
"supports",
"symbols",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ScriptableObject.java#L440-L444 |
21,328 | mozilla/rhino | src/org/mozilla/javascript/ScriptableObject.java | ScriptableObject.get | @Override
public Object get(Symbol key, Scriptable start)
{
Slot slot = slotMap.query(key, 0);
if (slot == null) {
return Scriptable.NOT_FOUND;
}
return slot.getValue(start);
} | java | @Override
public Object get(Symbol key, Scriptable start)
{
Slot slot = slotMap.query(key, 0);
if (slot == null) {
return Scriptable.NOT_FOUND;
}
return slot.getValue(start);
} | [
"@",
"Override",
"public",
"Object",
"get",
"(",
"Symbol",
"key",
",",
"Scriptable",
"start",
")",
"{",
"Slot",
"slot",
"=",
"slotMap",
".",
"query",
"(",
"key",
",",
"0",
")",
";",
"if",
"(",
"slot",
"==",
"null",
")",
"{",
"return",
"Scriptable",
... | Another version of Get that supports Symbol keyed properties. | [
"Another",
"version",
"of",
"Get",
"that",
"supports",
"Symbol",
"keyed",
"properties",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ScriptableObject.java#L493-L501 |
21,329 | mozilla/rhino | src/org/mozilla/javascript/ScriptableObject.java | ScriptableObject.put | @Override
public void put(Symbol key, Scriptable start, Object value)
{
if (putImpl(key, 0, start, value))
return;
if (start == this) throw Kit.codeBug();
ensureSymbolScriptable(start).put(key, start, value);
} | java | @Override
public void put(Symbol key, Scriptable start, Object value)
{
if (putImpl(key, 0, start, value))
return;
if (start == this) throw Kit.codeBug();
ensureSymbolScriptable(start).put(key, start, value);
} | [
"@",
"Override",
"public",
"void",
"put",
"(",
"Symbol",
"key",
",",
"Scriptable",
"start",
",",
"Object",
"value",
")",
"{",
"if",
"(",
"putImpl",
"(",
"key",
",",
"0",
",",
"start",
",",
"value",
")",
")",
"return",
";",
"if",
"(",
"start",
"==",... | Implementation of put required by SymbolScriptable objects. | [
"Implementation",
"of",
"put",
"required",
"by",
"SymbolScriptable",
"objects",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ScriptableObject.java#L561-L569 |
21,330 | mozilla/rhino | src/org/mozilla/javascript/ScriptableObject.java | ScriptableObject.delete | @Override
public void delete(int index)
{
checkNotSealed(null, index);
slotMap.remove(null, index);
} | java | @Override
public void delete(int index)
{
checkNotSealed(null, index);
slotMap.remove(null, index);
} | [
"@",
"Override",
"public",
"void",
"delete",
"(",
"int",
"index",
")",
"{",
"checkNotSealed",
"(",
"null",
",",
"index",
")",
";",
"slotMap",
".",
"remove",
"(",
"null",
",",
"index",
")",
";",
"}"
] | Removes the indexed property from the object.
If the property is not found, or it has the PERMANENT attribute,
no action is taken.
@param index the numeric index for the property | [
"Removes",
"the",
"indexed",
"property",
"from",
"the",
"object",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ScriptableObject.java#L594-L599 |
21,331 | mozilla/rhino | src/org/mozilla/javascript/ScriptableObject.java | ScriptableObject.putConst | @Override
public void putConst(String name, Scriptable start, Object value)
{
if (putConstImpl(name, 0, start, value, READONLY))
return;
if (start == this) throw Kit.codeBug();
if (start instanceof ConstProperties)
((ConstProperties)start).putConst(name, start, v... | java | @Override
public void putConst(String name, Scriptable start, Object value)
{
if (putConstImpl(name, 0, start, value, READONLY))
return;
if (start == this) throw Kit.codeBug();
if (start instanceof ConstProperties)
((ConstProperties)start).putConst(name, start, v... | [
"@",
"Override",
"public",
"void",
"putConst",
"(",
"String",
"name",
",",
"Scriptable",
"start",
",",
"Object",
"value",
")",
"{",
"if",
"(",
"putConstImpl",
"(",
"name",
",",
"0",
",",
"start",
",",
"value",
",",
"READONLY",
")",
")",
"return",
";",
... | Sets the value of the named const property, creating it if need be.
If the property was created using defineProperty, the
appropriate setter method is called. <p>
If the property's attributes include READONLY, no action is
taken.
This method will actually set the property in the start
object.
@param name the name of... | [
"Sets",
"the",
"value",
"of",
"the",
"named",
"const",
"property",
"creating",
"it",
"if",
"need",
"be",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ScriptableObject.java#L626-L637 |
21,332 | mozilla/rhino | src/org/mozilla/javascript/ScriptableObject.java | ScriptableObject.isConst | @Override
public boolean isConst(String name)
{
Slot slot = slotMap.query(name, 0);
if (slot == null) {
return false;
}
return (slot.getAttributes() & (PERMANENT|READONLY)) ==
(PERMANENT|READONLY);
} | java | @Override
public boolean isConst(String name)
{
Slot slot = slotMap.query(name, 0);
if (slot == null) {
return false;
}
return (slot.getAttributes() & (PERMANENT|READONLY)) ==
(PERMANENT|READONLY);
} | [
"@",
"Override",
"public",
"boolean",
"isConst",
"(",
"String",
"name",
")",
"{",
"Slot",
"slot",
"=",
"slotMap",
".",
"query",
"(",
"name",
",",
"0",
")",
";",
"if",
"(",
"slot",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"return",
"(",
... | Returns true if the named property is defined as a const on this object.
@param name
@return true if the named property is defined as a const, false
otherwise. | [
"Returns",
"true",
"if",
"the",
"named",
"property",
"is",
"defined",
"as",
"a",
"const",
"on",
"this",
"object",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ScriptableObject.java#L656-L666 |
21,333 | mozilla/rhino | src/org/mozilla/javascript/ScriptableObject.java | ScriptableObject.setAttributes | public void setAttributes(String name, int attributes)
{
checkNotSealed(name, 0);
findAttributeSlot(name, 0, SlotAccess.MODIFY).setAttributes(attributes);
} | java | public void setAttributes(String name, int attributes)
{
checkNotSealed(name, 0);
findAttributeSlot(name, 0, SlotAccess.MODIFY).setAttributes(attributes);
} | [
"public",
"void",
"setAttributes",
"(",
"String",
"name",
",",
"int",
"attributes",
")",
"{",
"checkNotSealed",
"(",
"name",
",",
"0",
")",
";",
"findAttributeSlot",
"(",
"name",
",",
"0",
",",
"SlotAccess",
".",
"MODIFY",
")",
".",
"setAttributes",
"(",
... | Set the attributes of a named property.
The property is specified by <code>name</code>
as defined for <code>has</code>.<p>
The possible attributes are READONLY, DONTENUM,
and PERMANENT. Combinations of attributes
are expressed by the bitwise OR of attributes.
EMPTY is the state of no attributes set. Any unused
bits a... | [
"Set",
"the",
"attributes",
"of",
"a",
"named",
"property",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ScriptableObject.java#L775-L779 |
21,334 | mozilla/rhino | src/org/mozilla/javascript/ScriptableObject.java | ScriptableObject.setAttributes | public void setAttributes(int index, int attributes)
{
checkNotSealed(null, index);
findAttributeSlot(null, index, SlotAccess.MODIFY).setAttributes(attributes);
} | java | public void setAttributes(int index, int attributes)
{
checkNotSealed(null, index);
findAttributeSlot(null, index, SlotAccess.MODIFY).setAttributes(attributes);
} | [
"public",
"void",
"setAttributes",
"(",
"int",
"index",
",",
"int",
"attributes",
")",
"{",
"checkNotSealed",
"(",
"null",
",",
"index",
")",
";",
"findAttributeSlot",
"(",
"null",
",",
"index",
",",
"SlotAccess",
".",
"MODIFY",
")",
".",
"setAttributes",
... | Set the attributes of an indexed property.
@param index the numeric index for the property
@param attributes the bitset of attributes
@exception EvaluatorException if the named property is not found
@see org.mozilla.javascript.Scriptable#has(String, Scriptable)
@see org.mozilla.javascript.ScriptableObject#READONLY
@se... | [
"Set",
"the",
"attributes",
"of",
"an",
"indexed",
"property",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ScriptableObject.java#L793-L797 |
21,335 | mozilla/rhino | src/org/mozilla/javascript/ScriptableObject.java | ScriptableObject.setAttributes | public void setAttributes(Symbol key, int attributes)
{
checkNotSealed(key, 0);
findAttributeSlot(key, SlotAccess.MODIFY).setAttributes(attributes);
} | java | public void setAttributes(Symbol key, int attributes)
{
checkNotSealed(key, 0);
findAttributeSlot(key, SlotAccess.MODIFY).setAttributes(attributes);
} | [
"public",
"void",
"setAttributes",
"(",
"Symbol",
"key",
",",
"int",
"attributes",
")",
"{",
"checkNotSealed",
"(",
"key",
",",
"0",
")",
";",
"findAttributeSlot",
"(",
"key",
",",
"SlotAccess",
".",
"MODIFY",
")",
".",
"setAttributes",
"(",
"attributes",
... | Set attributes of a Symbol-keyed property. | [
"Set",
"attributes",
"of",
"a",
"Symbol",
"-",
"keyed",
"property",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ScriptableObject.java#L802-L806 |
21,336 | mozilla/rhino | src/org/mozilla/javascript/ScriptableObject.java | ScriptableObject.isGetterOrSetter | protected boolean isGetterOrSetter(String name, int index, boolean setter) {
Slot slot = slotMap.query(name, index);
if (slot instanceof GetterSlot) {
if (setter && ((GetterSlot)slot).setter != null) return true;
if (!setter && ((GetterSlot)slot).getter != null) return true;
... | java | protected boolean isGetterOrSetter(String name, int index, boolean setter) {
Slot slot = slotMap.query(name, index);
if (slot instanceof GetterSlot) {
if (setter && ((GetterSlot)slot).setter != null) return true;
if (!setter && ((GetterSlot)slot).getter != null) return true;
... | [
"protected",
"boolean",
"isGetterOrSetter",
"(",
"String",
"name",
",",
"int",
"index",
",",
"boolean",
"setter",
")",
"{",
"Slot",
"slot",
"=",
"slotMap",
".",
"query",
"(",
"name",
",",
"index",
")",
";",
"if",
"(",
"slot",
"instanceof",
"GetterSlot",
... | Returns whether a property is a getter or a setter
@param name property name
@param index property index
@param setter true to check for a setter, false for a getter
@return whether the property is a getter or a setter | [
"Returns",
"whether",
"a",
"property",
"is",
"a",
"getter",
"or",
"a",
"setter"
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ScriptableObject.java#L886-L893 |
21,337 | mozilla/rhino | src/org/mozilla/javascript/ScriptableObject.java | ScriptableObject.defineClass | public static <T extends Scriptable> void defineClass(
Scriptable scope, Class<T> clazz)
throws IllegalAccessException, InstantiationException,
InvocationTargetException
{
defineClass(scope, clazz, false, false);
} | java | public static <T extends Scriptable> void defineClass(
Scriptable scope, Class<T> clazz)
throws IllegalAccessException, InstantiationException,
InvocationTargetException
{
defineClass(scope, clazz, false, false);
} | [
"public",
"static",
"<",
"T",
"extends",
"Scriptable",
">",
"void",
"defineClass",
"(",
"Scriptable",
"scope",
",",
"Class",
"<",
"T",
">",
"clazz",
")",
"throws",
"IllegalAccessException",
",",
"InstantiationException",
",",
"InvocationTargetException",
"{",
"def... | Defines JavaScript objects from a Java class that implements Scriptable.
If the given class has a method
<pre>
static void init(Context cx, Scriptable scope, boolean sealed);</pre>
or its compatibility form
<pre>
static void init(Scriptable scope);</pre>
then it is invoked and no further initialization is done.<p>
... | [
"Defines",
"JavaScript",
"objects",
"from",
"a",
"Java",
"class",
"that",
"implements",
"Scriptable",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ScriptableObject.java#L1232-L1238 |
21,338 | mozilla/rhino | src/org/mozilla/javascript/ScriptableObject.java | ScriptableObject.defineClass | public static <T extends Scriptable> String defineClass(
Scriptable scope, Class<T> clazz, boolean sealed,
boolean mapInheritance)
throws IllegalAccessException, InstantiationException,
InvocationTargetException
{
BaseFunction ctor = buildClassCtor(scope, clazz... | java | public static <T extends Scriptable> String defineClass(
Scriptable scope, Class<T> clazz, boolean sealed,
boolean mapInheritance)
throws IllegalAccessException, InstantiationException,
InvocationTargetException
{
BaseFunction ctor = buildClassCtor(scope, clazz... | [
"public",
"static",
"<",
"T",
"extends",
"Scriptable",
">",
"String",
"defineClass",
"(",
"Scriptable",
"scope",
",",
"Class",
"<",
"T",
">",
"clazz",
",",
"boolean",
"sealed",
",",
"boolean",
"mapInheritance",
")",
"throws",
"IllegalAccessException",
",",
"In... | Defines JavaScript objects from a Java class, optionally
allowing sealing and mapping of Java inheritance to JavaScript
prototype-based inheritance.
Similar to <code>defineClass(Scriptable scope, Class clazz)</code>
except that sealing and inheritance mapping are allowed. An object
that is sealed cannot have propertie... | [
"Defines",
"JavaScript",
"objects",
"from",
"a",
"Java",
"class",
"optionally",
"allowing",
"sealing",
"and",
"mapping",
"of",
"Java",
"inheritance",
"to",
"JavaScript",
"prototype",
"-",
"based",
"inheritance",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ScriptableObject.java#L1298-L1311 |
21,339 | mozilla/rhino | src/org/mozilla/javascript/ScriptableObject.java | ScriptableObject.defineProperty | public void defineProperty(Symbol key, Object value,
int attributes)
{
checkNotSealed(key, 0);
put(key, this, value);
setAttributes(key, attributes);
} | java | public void defineProperty(Symbol key, Object value,
int attributes)
{
checkNotSealed(key, 0);
put(key, this, value);
setAttributes(key, attributes);
} | [
"public",
"void",
"defineProperty",
"(",
"Symbol",
"key",
",",
"Object",
"value",
",",
"int",
"attributes",
")",
"{",
"checkNotSealed",
"(",
"key",
",",
"0",
")",
";",
"put",
"(",
"key",
",",
"this",
",",
"value",
")",
";",
"setAttributes",
"(",
"key",... | A version of defineProperty that uses a Symbol key.
@param key symbol of the property to define.
@param value the initial value of the property
@param attributes the attributes of the JavaScript property | [
"A",
"version",
"of",
"defineProperty",
"that",
"uses",
"a",
"Symbol",
"key",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ScriptableObject.java#L1648-L1654 |
21,340 | mozilla/rhino | src/org/mozilla/javascript/ScriptableObject.java | ScriptableObject.defineProperty | public void defineProperty(String propertyName, Class<?> clazz,
int attributes)
{
int length = propertyName.length();
if (length == 0) throw new IllegalArgumentException();
char[] buf = new char[3 + length];
propertyName.getChars(0, length, buf, 3);
... | java | public void defineProperty(String propertyName, Class<?> clazz,
int attributes)
{
int length = propertyName.length();
if (length == 0) throw new IllegalArgumentException();
char[] buf = new char[3 + length];
propertyName.getChars(0, length, buf, 3);
... | [
"public",
"void",
"defineProperty",
"(",
"String",
"propertyName",
",",
"Class",
"<",
"?",
">",
"clazz",
",",
"int",
"attributes",
")",
"{",
"int",
"length",
"=",
"propertyName",
".",
"length",
"(",
")",
";",
"if",
"(",
"length",
"==",
"0",
")",
"throw... | Define a JavaScript property with getter and setter side effects.
If the setter is not found, the attribute READONLY is added to
the given attributes. <p>
The getter must be a method with zero parameters, and the setter, if
found, must be a method with one parameter.<p>
@param propertyName the name of the property t... | [
"Define",
"a",
"JavaScript",
"property",
"with",
"getter",
"and",
"setter",
"side",
"effects",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ScriptableObject.java#L1714-L1736 |
21,341 | mozilla/rhino | src/org/mozilla/javascript/ScriptableObject.java | ScriptableObject.defineOwnProperties | public void defineOwnProperties(Context cx, ScriptableObject props) {
Object[] ids = props.getIds(false, true);
ScriptableObject[] descs = new ScriptableObject[ids.length];
for (int i = 0, len = ids.length; i < len; ++i) {
Object descObj = ScriptRuntime.getObjectElem(props, ids[i], c... | java | public void defineOwnProperties(Context cx, ScriptableObject props) {
Object[] ids = props.getIds(false, true);
ScriptableObject[] descs = new ScriptableObject[ids.length];
for (int i = 0, len = ids.length; i < len; ++i) {
Object descObj = ScriptRuntime.getObjectElem(props, ids[i], c... | [
"public",
"void",
"defineOwnProperties",
"(",
"Context",
"cx",
",",
"ScriptableObject",
"props",
")",
"{",
"Object",
"[",
"]",
"ids",
"=",
"props",
".",
"getIds",
"(",
"false",
",",
"true",
")",
";",
"ScriptableObject",
"[",
"]",
"descs",
"=",
"new",
"Sc... | Defines one or more properties on this object.
@param cx the current Context
@param props a map of property ids to property descriptors | [
"Defines",
"one",
"or",
"more",
"properties",
"on",
"this",
"object",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ScriptableObject.java#L1877-L1889 |
21,342 | mozilla/rhino | src/org/mozilla/javascript/ScriptableObject.java | ScriptableObject.sameValue | protected boolean sameValue(Object newValue, Object currentValue) {
if (newValue == NOT_FOUND) {
return true;
}
if (currentValue == NOT_FOUND) {
currentValue = Undefined.instance;
}
// Special rules for numbers: NaN is considered the same value,
//... | java | protected boolean sameValue(Object newValue, Object currentValue) {
if (newValue == NOT_FOUND) {
return true;
}
if (currentValue == NOT_FOUND) {
currentValue = Undefined.instance;
}
// Special rules for numbers: NaN is considered the same value,
//... | [
"protected",
"boolean",
"sameValue",
"(",
"Object",
"newValue",
",",
"Object",
"currentValue",
")",
"{",
"if",
"(",
"newValue",
"==",
"NOT_FOUND",
")",
"{",
"return",
"true",
";",
"}",
"if",
"(",
"currentValue",
"==",
"NOT_FOUND",
")",
"{",
"currentValue",
... | Implements SameValue as described in ES5 9.12, additionally checking
if new value is defined.
@param newValue the new value
@param currentValue the current value
@return true if values are the same as defined by ES5 9.12 | [
"Implements",
"SameValue",
"as",
"described",
"in",
"ES5",
"9",
".",
"12",
"additionally",
"checking",
"if",
"new",
"value",
"is",
"defined",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ScriptableObject.java#L2044-L2064 |
21,343 | mozilla/rhino | src/org/mozilla/javascript/ScriptableObject.java | ScriptableObject.defineFunctionProperties | public void defineFunctionProperties(String[] names, Class<?> clazz,
int attributes)
{
Method[] methods = FunctionObject.getMethodList(clazz);
for (int i=0; i < names.length; i++) {
String name = names[i];
Method m = FunctionObject.fin... | java | public void defineFunctionProperties(String[] names, Class<?> clazz,
int attributes)
{
Method[] methods = FunctionObject.getMethodList(clazz);
for (int i=0; i < names.length; i++) {
String name = names[i];
Method m = FunctionObject.fin... | [
"public",
"void",
"defineFunctionProperties",
"(",
"String",
"[",
"]",
"names",
",",
"Class",
"<",
"?",
">",
"clazz",
",",
"int",
"attributes",
")",
"{",
"Method",
"[",
"]",
"methods",
"=",
"FunctionObject",
".",
"getMethodList",
"(",
"clazz",
")",
";",
... | Search for names in a class, adding the resulting methods
as properties.
<p> Uses reflection to find the methods of the given names. Then
FunctionObjects are constructed from the methods found, and
are added to this object as properties with the given names.
@param names the names of the Methods to add as function pr... | [
"Search",
"for",
"names",
"in",
"a",
"class",
"adding",
"the",
"resulting",
"methods",
"as",
"properties",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ScriptableObject.java#L2148-L2162 |
21,344 | mozilla/rhino | src/org/mozilla/javascript/ScriptableObject.java | ScriptableObject.getObjectPrototype | public static Scriptable getObjectPrototype(Scriptable scope) {
return TopLevel.getBuiltinPrototype(getTopLevelScope(scope),
TopLevel.Builtins.Object);
} | java | public static Scriptable getObjectPrototype(Scriptable scope) {
return TopLevel.getBuiltinPrototype(getTopLevelScope(scope),
TopLevel.Builtins.Object);
} | [
"public",
"static",
"Scriptable",
"getObjectPrototype",
"(",
"Scriptable",
"scope",
")",
"{",
"return",
"TopLevel",
".",
"getBuiltinPrototype",
"(",
"getTopLevelScope",
"(",
"scope",
")",
",",
"TopLevel",
".",
"Builtins",
".",
"Object",
")",
";",
"}"
] | Get the Object.prototype property.
See ECMA 15.2.4.
@param scope an object in the scope chain | [
"Get",
"the",
"Object",
".",
"prototype",
"property",
".",
"See",
"ECMA",
"15",
".",
"2",
".",
"4",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ScriptableObject.java#L2169-L2172 |
21,345 | mozilla/rhino | src/org/mozilla/javascript/ScriptableObject.java | ScriptableObject.getFunctionPrototype | public static Scriptable getFunctionPrototype(Scriptable scope) {
return TopLevel.getBuiltinPrototype(getTopLevelScope(scope),
TopLevel.Builtins.Function);
} | java | public static Scriptable getFunctionPrototype(Scriptable scope) {
return TopLevel.getBuiltinPrototype(getTopLevelScope(scope),
TopLevel.Builtins.Function);
} | [
"public",
"static",
"Scriptable",
"getFunctionPrototype",
"(",
"Scriptable",
"scope",
")",
"{",
"return",
"TopLevel",
".",
"getBuiltinPrototype",
"(",
"getTopLevelScope",
"(",
"scope",
")",
",",
"TopLevel",
".",
"Builtins",
".",
"Function",
")",
";",
"}"
] | Get the Function.prototype property.
See ECMA 15.3.4.
@param scope an object in the scope chain | [
"Get",
"the",
"Function",
".",
"prototype",
"property",
".",
"See",
"ECMA",
"15",
".",
"3",
".",
"4",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ScriptableObject.java#L2179-L2182 |
21,346 | mozilla/rhino | src/org/mozilla/javascript/ScriptableObject.java | ScriptableObject.getClassPrototype | public static Scriptable getClassPrototype(Scriptable scope,
String className)
{
scope = getTopLevelScope(scope);
Object ctor = getProperty(scope, className);
Object proto;
if (ctor instanceof BaseFunction) {
proto = ((BaseFu... | java | public static Scriptable getClassPrototype(Scriptable scope,
String className)
{
scope = getTopLevelScope(scope);
Object ctor = getProperty(scope, className);
Object proto;
if (ctor instanceof BaseFunction) {
proto = ((BaseFu... | [
"public",
"static",
"Scriptable",
"getClassPrototype",
"(",
"Scriptable",
"scope",
",",
"String",
"className",
")",
"{",
"scope",
"=",
"getTopLevelScope",
"(",
"scope",
")",
";",
"Object",
"ctor",
"=",
"getProperty",
"(",
"scope",
",",
"className",
")",
";",
... | Get the prototype for the named class.
For example, <code>getClassPrototype(s, "Date")</code> will first
walk up the parent chain to find the outermost scope, then will
search that scope for the Date constructor, and then will
return Date.prototype. If any of the lookups fail, or
the prototype is not a JavaScript obje... | [
"Get",
"the",
"prototype",
"for",
"the",
"named",
"class",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ScriptableObject.java#L2204-L2222 |
21,347 | mozilla/rhino | src/org/mozilla/javascript/ScriptableObject.java | ScriptableObject.getTopLevelScope | public static Scriptable getTopLevelScope(Scriptable obj)
{
for (;;) {
Scriptable parent = obj.getParentScope();
if (parent == null) {
return obj;
}
obj = parent;
}
} | java | public static Scriptable getTopLevelScope(Scriptable obj)
{
for (;;) {
Scriptable parent = obj.getParentScope();
if (parent == null) {
return obj;
}
obj = parent;
}
} | [
"public",
"static",
"Scriptable",
"getTopLevelScope",
"(",
"Scriptable",
"obj",
")",
"{",
"for",
"(",
";",
";",
")",
"{",
"Scriptable",
"parent",
"=",
"obj",
".",
"getParentScope",
"(",
")",
";",
"if",
"(",
"parent",
"==",
"null",
")",
"{",
"return",
"... | Get the global scope.
<p>Walks the parent scope chain to find an object with a null
parent scope (the global object).
@param obj a JavaScript object
@return the corresponding global scope | [
"Get",
"the",
"global",
"scope",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ScriptableObject.java#L2233-L2242 |
21,348 | mozilla/rhino | src/org/mozilla/javascript/ScriptableObject.java | ScriptableObject.sealObject | public void sealObject() {
if (!isSealed) {
final long stamp = slotMap.readLock();
try {
for (Slot slot : slotMap) {
Object value = slot.value;
if (value instanceof LazilyLoadedCtor) {
LazilyLoadedCtor initia... | java | public void sealObject() {
if (!isSealed) {
final long stamp = slotMap.readLock();
try {
for (Slot slot : slotMap) {
Object value = slot.value;
if (value instanceof LazilyLoadedCtor) {
LazilyLoadedCtor initia... | [
"public",
"void",
"sealObject",
"(",
")",
"{",
"if",
"(",
"!",
"isSealed",
")",
"{",
"final",
"long",
"stamp",
"=",
"slotMap",
".",
"readLock",
"(",
")",
";",
"try",
"{",
"for",
"(",
"Slot",
"slot",
":",
"slotMap",
")",
"{",
"Object",
"value",
"=",... | Seal this object.
It is an error to add properties to or delete properties from
a sealed object. It is possible to change the value of an
existing property. Once an object is sealed it may not be unsealed.
@since 1.4R3 | [
"Seal",
"this",
"object",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ScriptableObject.java#L2261-L2281 |
21,349 | mozilla/rhino | src/org/mozilla/javascript/ScriptableObject.java | ScriptableObject.getProperty | public static Object getProperty(Scriptable obj, Symbol key)
{
Scriptable start = obj;
Object result;
do {
result = ensureSymbolScriptable(obj).get(key, start);
if (result != Scriptable.NOT_FOUND)
break;
obj = obj.getPrototype();
} ... | java | public static Object getProperty(Scriptable obj, Symbol key)
{
Scriptable start = obj;
Object result;
do {
result = ensureSymbolScriptable(obj).get(key, start);
if (result != Scriptable.NOT_FOUND)
break;
obj = obj.getPrototype();
} ... | [
"public",
"static",
"Object",
"getProperty",
"(",
"Scriptable",
"obj",
",",
"Symbol",
"key",
")",
"{",
"Scriptable",
"start",
"=",
"obj",
";",
"Object",
"result",
";",
"do",
"{",
"result",
"=",
"ensureSymbolScriptable",
"(",
"obj",
")",
".",
"get",
"(",
... | This is a version of getProperty that works with Symbols. | [
"This",
"is",
"a",
"version",
"of",
"getProperty",
"that",
"works",
"with",
"Symbols",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ScriptableObject.java#L2331-L2342 |
21,350 | mozilla/rhino | src/org/mozilla/javascript/ScriptableObject.java | ScriptableObject.putProperty | public static void putProperty(Scriptable obj, Symbol key, Object value)
{
Scriptable base = getBase(obj, key);
if (base == null)
base = obj;
ensureSymbolScriptable(base).put(key, obj, value);
} | java | public static void putProperty(Scriptable obj, Symbol key, Object value)
{
Scriptable base = getBase(obj, key);
if (base == null)
base = obj;
ensureSymbolScriptable(base).put(key, obj, value);
} | [
"public",
"static",
"void",
"putProperty",
"(",
"Scriptable",
"obj",
",",
"Symbol",
"key",
",",
"Object",
"value",
")",
"{",
"Scriptable",
"base",
"=",
"getBase",
"(",
"obj",
",",
"key",
")",
";",
"if",
"(",
"base",
"==",
"null",
")",
"base",
"=",
"o... | This is a version of putProperty for Symbol keys. | [
"This",
"is",
"a",
"version",
"of",
"putProperty",
"for",
"Symbol",
"keys",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ScriptableObject.java#L2513-L2519 |
21,351 | mozilla/rhino | src/org/mozilla/javascript/ScriptableObject.java | ScriptableObject.callMethod | public static Object callMethod(Context cx, Scriptable obj,
String methodName,
Object[] args)
{
Object funObj = getProperty(obj, methodName);
if (!(funObj instanceof Function)) {
throw ScriptRuntime.notFunctionError(... | java | public static Object callMethod(Context cx, Scriptable obj,
String methodName,
Object[] args)
{
Object funObj = getProperty(obj, methodName);
if (!(funObj instanceof Function)) {
throw ScriptRuntime.notFunctionError(... | [
"public",
"static",
"Object",
"callMethod",
"(",
"Context",
"cx",
",",
"Scriptable",
"obj",
",",
"String",
"methodName",
",",
"Object",
"[",
"]",
"args",
")",
"{",
"Object",
"funObj",
"=",
"getProperty",
"(",
"obj",
",",
"methodName",
")",
";",
"if",
"("... | Call a method of an object.
@param cx the Context object associated with the current thread.
@param obj the JavaScript object
@param methodName the name of the function property
@param args the arguments for the call | [
"Call",
"a",
"method",
"of",
"an",
"object",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ScriptableObject.java#L2675-L2696 |
21,352 | mozilla/rhino | src/org/mozilla/javascript/ScriptableObject.java | ScriptableObject.getAssociatedValue | public final Object getAssociatedValue(Object key)
{
Map<Object,Object> h = associatedValues;
if (h == null)
return null;
return h.get(key);
} | java | public final Object getAssociatedValue(Object key)
{
Map<Object,Object> h = associatedValues;
if (h == null)
return null;
return h.get(key);
} | [
"public",
"final",
"Object",
"getAssociatedValue",
"(",
"Object",
"key",
")",
"{",
"Map",
"<",
"Object",
",",
"Object",
">",
"h",
"=",
"associatedValues",
";",
"if",
"(",
"h",
"==",
"null",
")",
"return",
"null",
";",
"return",
"h",
".",
"get",
"(",
... | Get arbitrary application-specific value associated with this object.
@param key key object to select particular value.
@see #associateValue(Object key, Object value) | [
"Get",
"arbitrary",
"application",
"-",
"specific",
"value",
"associated",
"with",
"this",
"object",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ScriptableObject.java#L2733-L2739 |
21,353 | mozilla/rhino | src/org/mozilla/javascript/optimizer/Codegen.java | Codegen.generateResumeGenerator | private void generateResumeGenerator(ClassFileWriter cfw)
{
boolean hasGenerators = false;
for (int i=0; i < scriptOrFnNodes.length; i++) {
if (isGenerator(scriptOrFnNodes[i]))
hasGenerators = true;
}
// if there are no generators defined, we don't implem... | java | private void generateResumeGenerator(ClassFileWriter cfw)
{
boolean hasGenerators = false;
for (int i=0; i < scriptOrFnNodes.length; i++) {
if (isGenerator(scriptOrFnNodes[i]))
hasGenerators = true;
}
// if there are no generators defined, we don't implem... | [
"private",
"void",
"generateResumeGenerator",
"(",
"ClassFileWriter",
"cfw",
")",
"{",
"boolean",
"hasGenerators",
"=",
"false",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"scriptOrFnNodes",
".",
"length",
";",
"i",
"++",
")",
"{",
"if",
"(",
... | appended by "_gen". | [
"appended",
"by",
"_gen",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/optimizer/Codegen.java#L414-L476 |
21,354 | mozilla/rhino | src/org/mozilla/javascript/optimizer/Codegen.java | Codegen.cleanName | String cleanName(final ScriptNode n)
{
String result = "";
if (n instanceof FunctionNode) {
Name name = ((FunctionNode) n).getFunctionName();
if (name == null) {
result = "anonymous";
} else {
result = name.getIdentifier();
}
} else {
res... | java | String cleanName(final ScriptNode n)
{
String result = "";
if (n instanceof FunctionNode) {
Name name = ((FunctionNode) n).getFunctionName();
if (name == null) {
result = "anonymous";
} else {
result = name.getIdentifier();
}
} else {
res... | [
"String",
"cleanName",
"(",
"final",
"ScriptNode",
"n",
")",
"{",
"String",
"result",
"=",
"\"\"",
";",
"if",
"(",
"n",
"instanceof",
"FunctionNode",
")",
"{",
"Name",
"name",
"=",
"(",
"(",
"FunctionNode",
")",
"n",
")",
".",
"getFunctionName",
"(",
"... | Gets a Java-compatible "informative" name for the the ScriptOrFnNode | [
"Gets",
"a",
"Java",
"-",
"compatible",
"informative",
"name",
"for",
"the",
"the",
"ScriptOrFnNode"
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/optimizer/Codegen.java#L1168-L1182 |
21,355 | mozilla/rhino | src/org/mozilla/javascript/optimizer/Codegen.java | BodyCodegen.addLoadPropertyIds | private void addLoadPropertyIds(Object[] properties, int count) {
addNewObjectArray(count);
for (int i = 0; i != count; ++i) {
cfw.add(ByteCode.DUP);
cfw.addPush(i);
Object id = properties[i];
if (id instanceof String) {
cfw.addPush((String... | java | private void addLoadPropertyIds(Object[] properties, int count) {
addNewObjectArray(count);
for (int i = 0; i != count; ++i) {
cfw.add(ByteCode.DUP);
cfw.addPush(i);
Object id = properties[i];
if (id instanceof String) {
cfw.addPush((String... | [
"private",
"void",
"addLoadPropertyIds",
"(",
"Object",
"[",
"]",
"properties",
",",
"int",
"count",
")",
"{",
"addNewObjectArray",
"(",
"count",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"!=",
"count",
";",
"++",
"i",
")",
"{",
"cfw",
... | load array with property ids | [
"load",
"array",
"with",
"property",
"ids"
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/optimizer/Codegen.java#L3169-L3183 |
21,356 | mozilla/rhino | src/org/mozilla/javascript/optimizer/Codegen.java | BodyCodegen.addLoadPropertyValues | private void addLoadPropertyValues(Node node, Node child, int count) {
if (isGenerator) {
// see bug 757410 for an explanation why we need to split this
for (int i = 0; i != count; ++i) {
int childType = child.getType();
if (childType == Token.GET || child... | java | private void addLoadPropertyValues(Node node, Node child, int count) {
if (isGenerator) {
// see bug 757410 for an explanation why we need to split this
for (int i = 0; i != count; ++i) {
int childType = child.getType();
if (childType == Token.GET || child... | [
"private",
"void",
"addLoadPropertyValues",
"(",
"Node",
"node",
",",
"Node",
"child",
",",
"int",
"count",
")",
"{",
"if",
"(",
"isGenerator",
")",
"{",
"// see bug 757410 for an explanation why we need to split this",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i"... | load array with property values | [
"load",
"array",
"with",
"property",
"values"
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/optimizer/Codegen.java#L3186-L3222 |
21,357 | mozilla/rhino | src/org/mozilla/javascript/optimizer/Codegen.java | BodyCodegen.inlineFinally | private void inlineFinally(Node finallyTarget, int finallyStart,
int finallyEnd) {
Node fBlock = getFinallyAtTarget(finallyTarget);
fBlock.resetTargets();
Node child = fBlock.getFirstChild();
exceptionManager.markInlineFinallyStart(fBlock, finallyStart);
... | java | private void inlineFinally(Node finallyTarget, int finallyStart,
int finallyEnd) {
Node fBlock = getFinallyAtTarget(finallyTarget);
fBlock.resetTargets();
Node child = fBlock.getFirstChild();
exceptionManager.markInlineFinallyStart(fBlock, finallyStart);
... | [
"private",
"void",
"inlineFinally",
"(",
"Node",
"finallyTarget",
",",
"int",
"finallyStart",
",",
"int",
"finallyEnd",
")",
"{",
"Node",
"fBlock",
"=",
"getFinallyAtTarget",
"(",
"finallyTarget",
")",
";",
"fBlock",
".",
"resetTargets",
"(",
")",
";",
"Node",... | Inline a FINALLY node into the method bytecode.
This method takes a label that points to the real start of the finally
block as implemented in the bytecode. This is because in some cases,
the finally block really starts before any of the code in the Node. For
example, the catch-all-rethrow finally block has a few inst... | [
"Inline",
"a",
"FINALLY",
"node",
"into",
"the",
"method",
"bytecode",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/optimizer/Codegen.java#L4211-L4222 |
21,358 | mozilla/rhino | src/org/mozilla/javascript/optimizer/Codegen.java | BodyCodegen.getFinallyAtTarget | private Node getFinallyAtTarget(Node node) {
if (node == null) {
return null;
}
if (node.getType() == Token.FINALLY) {
return node;
}
if (node.getType() == Token.TARGET) {
Node fBlock = node.getNext();
if (fBlock != null && fBlock.g... | java | private Node getFinallyAtTarget(Node node) {
if (node == null) {
return null;
}
if (node.getType() == Token.FINALLY) {
return node;
}
if (node.getType() == Token.TARGET) {
Node fBlock = node.getNext();
if (fBlock != null && fBlock.g... | [
"private",
"Node",
"getFinallyAtTarget",
"(",
"Node",
"node",
")",
"{",
"if",
"(",
"node",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"node",
".",
"getType",
"(",
")",
"==",
"Token",
".",
"FINALLY",
")",
"{",
"return",
"node",
"... | Get a FINALLY node at a point in the IR.
This is strongly dependent on the generated IR. If the node is a TARGET,
it only check the next node to see if it is a FINALLY node. | [
"Get",
"a",
"FINALLY",
"node",
"at",
"a",
"point",
"in",
"the",
"IR",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/optimizer/Codegen.java#L4238-L4252 |
21,359 | mozilla/rhino | xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLLibImpl.java | XMLLibImpl.toDomNode | public static org.w3c.dom.Node toDomNode(Object xmlObject) {
// Could return DocumentFragment for XMLList
// Probably a single node for XMLList with one element
if (xmlObject instanceof XML) {
return ((XML)xmlObject).toDomNode();
} else {
throw new IllegalAr... | java | public static org.w3c.dom.Node toDomNode(Object xmlObject) {
// Could return DocumentFragment for XMLList
// Probably a single node for XMLList with one element
if (xmlObject instanceof XML) {
return ((XML)xmlObject).toDomNode();
} else {
throw new IllegalAr... | [
"public",
"static",
"org",
".",
"w3c",
".",
"dom",
".",
"Node",
"toDomNode",
"(",
"Object",
"xmlObject",
")",
"{",
"// Could return DocumentFragment for XMLList",
"// Probably a single node for XMLList with one element",
"if",
"(",
"xmlObject",
"instanceof",
"XML",
... | This experimental interface is undocumented. | [
"This",
"experimental",
"interface",
"is",
"undocumented",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/xmlimplsrc/org/mozilla/javascript/xmlimpl/XMLLibImpl.java#L33-L42 |
21,360 | mozilla/rhino | src/org/mozilla/javascript/ast/WithStatement.java | WithStatement.visit | @Override
public void visit(NodeVisitor v) {
if (v.visit(this)) {
expression.visit(v);
statement.visit(v);
}
} | java | @Override
public void visit(NodeVisitor v) {
if (v.visit(this)) {
expression.visit(v);
statement.visit(v);
}
} | [
"@",
"Override",
"public",
"void",
"visit",
"(",
"NodeVisitor",
"v",
")",
"{",
"if",
"(",
"v",
".",
"visit",
"(",
"this",
")",
")",
"{",
"expression",
".",
"visit",
"(",
"v",
")",
";",
"statement",
".",
"visit",
"(",
"v",
")",
";",
"}",
"}"
] | Visits this node, then the with-object, then the body statement. | [
"Visits",
"this",
"node",
"then",
"the",
"with",
"-",
"object",
"then",
"the",
"body",
"statement",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ast/WithStatement.java#L134-L140 |
21,361 | mozilla/rhino | toolsrc/org/mozilla/javascript/tools/shell/Global.java | Global.write | public static Object write(Context cx, Scriptable thisObj,
Object[] args, Function funObj)
{
return doPrint(args, funObj, false);
} | java | public static Object write(Context cx, Scriptable thisObj,
Object[] args, Function funObj)
{
return doPrint(args, funObj, false);
} | [
"public",
"static",
"Object",
"write",
"(",
"Context",
"cx",
",",
"Scriptable",
"thisObj",
",",
"Object",
"[",
"]",
"args",
",",
"Function",
"funObj",
")",
"{",
"return",
"doPrint",
"(",
"args",
",",
"funObj",
",",
"false",
")",
";",
"}"
] | Print just as in "print," but without the trailing newline. | [
"Print",
"just",
"as",
"in",
"print",
"but",
"without",
"the",
"trailing",
"newline",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/toolsrc/org/mozilla/javascript/tools/shell/Global.java#L226-L230 |
21,362 | mozilla/rhino | toolsrc/org/mozilla/javascript/tools/shell/Global.java | Global.quit | public static void quit(Context cx, Scriptable thisObj,
Object[] args, Function funObj)
{
Global global = getInstance(funObj);
if (global.quitAction != null) {
int exitCode = (args.length == 0 ? 0
: ScriptRuntime.toInt32(args[0]));
... | java | public static void quit(Context cx, Scriptable thisObj,
Object[] args, Function funObj)
{
Global global = getInstance(funObj);
if (global.quitAction != null) {
int exitCode = (args.length == 0 ? 0
: ScriptRuntime.toInt32(args[0]));
... | [
"public",
"static",
"void",
"quit",
"(",
"Context",
"cx",
",",
"Scriptable",
"thisObj",
",",
"Object",
"[",
"]",
"args",
",",
"Function",
"funObj",
")",
"{",
"Global",
"global",
"=",
"getInstance",
"(",
"funObj",
")",
";",
"if",
"(",
"global",
".",
"qu... | Call embedding-specific quit action passing its argument as
int32 exit code.
This method is defined as a JavaScript function. | [
"Call",
"embedding",
"-",
"specific",
"quit",
"action",
"passing",
"its",
"argument",
"as",
"int32",
"exit",
"code",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/toolsrc/org/mozilla/javascript/tools/shell/Global.java#L256-L265 |
21,363 | mozilla/rhino | toolsrc/org/mozilla/javascript/tools/shell/Global.java | Global.spawn | public static Object spawn(Context cx, Scriptable thisObj, Object[] args,
Function funObj)
{
Scriptable scope = funObj.getParentScope();
Runner runner;
if (args.length != 0 && args[0] instanceof Function) {
Object[] newArgs = null;
if (a... | java | public static Object spawn(Context cx, Scriptable thisObj, Object[] args,
Function funObj)
{
Scriptable scope = funObj.getParentScope();
Runner runner;
if (args.length != 0 && args[0] instanceof Function) {
Object[] newArgs = null;
if (a... | [
"public",
"static",
"Object",
"spawn",
"(",
"Context",
"cx",
",",
"Scriptable",
"thisObj",
",",
"Object",
"[",
"]",
"args",
",",
"Function",
"funObj",
")",
"{",
"Scriptable",
"scope",
"=",
"funObj",
".",
"getParentScope",
"(",
")",
";",
"Runner",
"runner",... | The spawn function runs a given function or script in a different
thread.
js> function g() { a = 7; }
js> a = 3;
3
js> spawn(g)
Thread[Thread-1,5,main]
js> a
3 | [
"The",
"spawn",
"function",
"runs",
"a",
"given",
"function",
"or",
"script",
"in",
"a",
"different",
"thread",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/toolsrc/org/mozilla/javascript/tools/shell/Global.java#L590-L611 |
21,364 | mozilla/rhino | toolsrc/org/mozilla/javascript/tools/shell/Global.java | Global.seal | public static void seal(Context cx, Scriptable thisObj, Object[] args,
Function funObj)
{
for (int i = 0; i != args.length; ++i) {
Object arg = args[i];
if (!(arg instanceof ScriptableObject) || arg == Undefined.instance)
{
if (... | java | public static void seal(Context cx, Scriptable thisObj, Object[] args,
Function funObj)
{
for (int i = 0; i != args.length; ++i) {
Object arg = args[i];
if (!(arg instanceof ScriptableObject) || arg == Undefined.instance)
{
if (... | [
"public",
"static",
"void",
"seal",
"(",
"Context",
"cx",
",",
"Scriptable",
"thisObj",
",",
"Object",
"[",
"]",
"args",
",",
"Function",
"funObj",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"!=",
"args",
".",
"length",
";",
"++",
"i",
... | The seal function seals all supplied arguments. | [
"The",
"seal",
"function",
"seals",
"all",
"supplied",
"arguments",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/toolsrc/org/mozilla/javascript/tools/shell/Global.java#L803-L823 |
21,365 | mozilla/rhino | toolsrc/org/mozilla/javascript/tools/shell/Global.java | Global.toint32 | public static Object toint32(Context cx, Scriptable thisObj, Object[] args,
Function funObj)
{
Object arg = (args.length != 0 ? args[0] : Undefined.instance);
if (arg instanceof Integer)
return arg;
return ScriptRuntime.wrapInt(ScriptRuntime.toInt... | java | public static Object toint32(Context cx, Scriptable thisObj, Object[] args,
Function funObj)
{
Object arg = (args.length != 0 ? args[0] : Undefined.instance);
if (arg instanceof Integer)
return arg;
return ScriptRuntime.wrapInt(ScriptRuntime.toInt... | [
"public",
"static",
"Object",
"toint32",
"(",
"Context",
"cx",
",",
"Scriptable",
"thisObj",
",",
"Object",
"[",
"]",
"args",
",",
"Function",
"funObj",
")",
"{",
"Object",
"arg",
"=",
"(",
"args",
".",
"length",
"!=",
"0",
"?",
"args",
"[",
"0",
"]"... | Convert the argument to int32 number. | [
"Convert",
"the",
"argument",
"to",
"int32",
"number",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/toolsrc/org/mozilla/javascript/tools/shell/Global.java#L887-L894 |
21,366 | mozilla/rhino | src/org/mozilla/javascript/Node.java | Node.getJsDoc | public String getJsDoc() {
Comment comment = getJsDocNode();
if (comment != null) {
return comment.getValue();
}
return null;
} | java | public String getJsDoc() {
Comment comment = getJsDocNode();
if (comment != null) {
return comment.getValue();
}
return null;
} | [
"public",
"String",
"getJsDoc",
"(",
")",
"{",
"Comment",
"comment",
"=",
"getJsDocNode",
"(",
")",
";",
"if",
"(",
"comment",
"!=",
"null",
")",
"{",
"return",
"comment",
".",
"getValue",
"(",
")",
";",
"}",
"return",
"null",
";",
"}"
] | Gets the JsDoc comment string attached to this node.
@return the comment string or {@code null} if no JsDoc is attached to
this node | [
"Gets",
"the",
"JsDoc",
"comment",
"string",
"attached",
"to",
"this",
"node",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/Node.java#L179-L185 |
21,367 | mozilla/rhino | src/org/mozilla/javascript/Node.java | Node.addChildAfter | public void addChildAfter(Node newChild, Node node) {
if (newChild.next != null)
throw new RuntimeException(
"newChild had siblings in addChildAfter");
newChild.next = node.next;
node.next = newChild;
if (last == node)
last = newChild;
} | java | public void addChildAfter(Node newChild, Node node) {
if (newChild.next != null)
throw new RuntimeException(
"newChild had siblings in addChildAfter");
newChild.next = node.next;
node.next = newChild;
if (last == node)
last = newChild;
} | [
"public",
"void",
"addChildAfter",
"(",
"Node",
"newChild",
",",
"Node",
"node",
")",
"{",
"if",
"(",
"newChild",
".",
"next",
"!=",
"null",
")",
"throw",
"new",
"RuntimeException",
"(",
"\"newChild had siblings in addChildAfter\"",
")",
";",
"newChild",
".",
... | Add 'child' after 'node'. | [
"Add",
"child",
"after",
"node",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/Node.java#L295-L303 |
21,368 | mozilla/rhino | src/org/mozilla/javascript/Node.java | Node.endCheckIf | private int endCheckIf()
{
Node th, el;
int rv = END_UNREACHED;
th = next;
el = ((Jump)this).target;
rv = th.endCheck();
if (el != null)
rv |= el.endCheck();
else
rv |= END_DROPS_OFF;
return rv;
} | java | private int endCheckIf()
{
Node th, el;
int rv = END_UNREACHED;
th = next;
el = ((Jump)this).target;
rv = th.endCheck();
if (el != null)
rv |= el.endCheck();
else
rv |= END_DROPS_OFF;
return rv;
} | [
"private",
"int",
"endCheckIf",
"(",
")",
"{",
"Node",
"th",
",",
"el",
";",
"int",
"rv",
"=",
"END_UNREACHED",
";",
"th",
"=",
"next",
";",
"el",
"=",
"(",
"(",
"Jump",
")",
"this",
")",
".",
"target",
";",
"rv",
"=",
"th",
".",
"endCheck",
"(... | Returns in the then and else blocks must be consistent with each other.
If there is no else block, then the return statement can fall through.
@return logical OR of END_* flags | [
"Returns",
"in",
"the",
"then",
"and",
"else",
"blocks",
"must",
"be",
"consistent",
"with",
"each",
"other",
".",
"If",
"there",
"is",
"no",
"else",
"block",
"then",
"the",
"return",
"statement",
"can",
"fall",
"through",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/Node.java#L658-L674 |
21,369 | mozilla/rhino | src/org/mozilla/javascript/Node.java | Node.endCheckLabel | private int endCheckLabel()
{
int rv = END_UNREACHED;
rv = next.endCheck();
rv |= getIntProp(CONTROL_BLOCK_PROP, END_UNREACHED);
return rv;
} | java | private int endCheckLabel()
{
int rv = END_UNREACHED;
rv = next.endCheck();
rv |= getIntProp(CONTROL_BLOCK_PROP, END_UNREACHED);
return rv;
} | [
"private",
"int",
"endCheckLabel",
"(",
")",
"{",
"int",
"rv",
"=",
"END_UNREACHED",
";",
"rv",
"=",
"next",
".",
"endCheck",
"(",
")",
";",
"rv",
"|=",
"getIntProp",
"(",
"CONTROL_BLOCK_PROP",
",",
"END_UNREACHED",
")",
";",
"return",
"rv",
";",
"}"
] | A labelled statement implies that there maybe a break to the label. The
function processes the labelled statement and then checks the
CONTROL_BLOCK_PROP property to see if there is ever a break to the
particular label.
@return logical OR of END_* flags | [
"A",
"labelled",
"statement",
"implies",
"that",
"there",
"maybe",
"a",
"break",
"to",
"the",
"label",
".",
"The",
"function",
"processes",
"the",
"labelled",
"statement",
"and",
"then",
"checks",
"the",
"CONTROL_BLOCK_PROP",
"property",
"to",
"see",
"if",
"th... | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/Node.java#L829-L837 |
21,370 | mozilla/rhino | src/org/mozilla/javascript/Node.java | Node.endCheckBreak | private int endCheckBreak()
{
Node n = ((Jump) this).getJumpStatement();
n.putIntProp(CONTROL_BLOCK_PROP, END_DROPS_OFF);
return END_UNREACHED;
} | java | private int endCheckBreak()
{
Node n = ((Jump) this).getJumpStatement();
n.putIntProp(CONTROL_BLOCK_PROP, END_DROPS_OFF);
return END_UNREACHED;
} | [
"private",
"int",
"endCheckBreak",
"(",
")",
"{",
"Node",
"n",
"=",
"(",
"(",
"Jump",
")",
"this",
")",
".",
"getJumpStatement",
"(",
")",
";",
"n",
".",
"putIntProp",
"(",
"CONTROL_BLOCK_PROP",
",",
"END_DROPS_OFF",
")",
";",
"return",
"END_UNREACHED",
... | When a break is encountered annotate the statement being broken
out of by setting its CONTROL_BLOCK_PROP property.
@return logical OR of END_* flags | [
"When",
"a",
"break",
"is",
"encountered",
"annotate",
"the",
"statement",
"being",
"broken",
"out",
"of",
"by",
"setting",
"its",
"CONTROL_BLOCK_PROP",
"property",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/Node.java#L844-L849 |
21,371 | mozilla/rhino | src/org/mozilla/javascript/ast/ReturnStatement.java | ReturnStatement.visit | @Override
public void visit(NodeVisitor v) {
if (v.visit(this) && returnValue != null) {
returnValue.visit(v);
}
} | java | @Override
public void visit(NodeVisitor v) {
if (v.visit(this) && returnValue != null) {
returnValue.visit(v);
}
} | [
"@",
"Override",
"public",
"void",
"visit",
"(",
"NodeVisitor",
"v",
")",
"{",
"if",
"(",
"v",
".",
"visit",
"(",
"this",
")",
"&&",
"returnValue",
"!=",
"null",
")",
"{",
"returnValue",
".",
"visit",
"(",
"v",
")",
";",
"}",
"}"
] | Visits this node, then the return value if specified. | [
"Visits",
"this",
"node",
"then",
"the",
"return",
"value",
"if",
"specified",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ast/ReturnStatement.java#L74-L79 |
21,372 | mozilla/rhino | toolsrc/org/mozilla/javascript/tools/debugger/Main.java | Main.setBreakOnExceptions | public void setBreakOnExceptions(boolean value) {
dim.setBreakOnExceptions(value);
debugGui.getMenubar().getBreakOnExceptions().setSelected(value);
} | java | public void setBreakOnExceptions(boolean value) {
dim.setBreakOnExceptions(value);
debugGui.getMenubar().getBreakOnExceptions().setSelected(value);
} | [
"public",
"void",
"setBreakOnExceptions",
"(",
"boolean",
"value",
")",
"{",
"dim",
".",
"setBreakOnExceptions",
"(",
"value",
")",
";",
"debugGui",
".",
"getMenubar",
"(",
")",
".",
"getBreakOnExceptions",
"(",
")",
".",
"setSelected",
"(",
"value",
")",
";... | Sets whether execution should break when a script exception is thrown. | [
"Sets",
"whether",
"execution",
"should",
"break",
"when",
"a",
"script",
"exception",
"is",
"thrown",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/toolsrc/org/mozilla/javascript/tools/debugger/Main.java#L61-L64 |
21,373 | mozilla/rhino | toolsrc/org/mozilla/javascript/tools/debugger/Main.java | Main.setBreakOnEnter | public void setBreakOnEnter(boolean value) {
dim.setBreakOnEnter(value);
debugGui.getMenubar().getBreakOnEnter().setSelected(value);
} | java | public void setBreakOnEnter(boolean value) {
dim.setBreakOnEnter(value);
debugGui.getMenubar().getBreakOnEnter().setSelected(value);
} | [
"public",
"void",
"setBreakOnEnter",
"(",
"boolean",
"value",
")",
"{",
"dim",
".",
"setBreakOnEnter",
"(",
"value",
")",
";",
"debugGui",
".",
"getMenubar",
"(",
")",
".",
"getBreakOnEnter",
"(",
")",
".",
"setSelected",
"(",
"value",
")",
";",
"}"
] | Sets whether execution should break when a function is entered. | [
"Sets",
"whether",
"execution",
"should",
"break",
"when",
"a",
"function",
"is",
"entered",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/toolsrc/org/mozilla/javascript/tools/debugger/Main.java#L69-L72 |
21,374 | mozilla/rhino | toolsrc/org/mozilla/javascript/tools/debugger/Main.java | Main.setBreakOnReturn | public void setBreakOnReturn(boolean value) {
dim.setBreakOnReturn(value);
debugGui.getMenubar().getBreakOnReturn().setSelected(value);
} | java | public void setBreakOnReturn(boolean value) {
dim.setBreakOnReturn(value);
debugGui.getMenubar().getBreakOnReturn().setSelected(value);
} | [
"public",
"void",
"setBreakOnReturn",
"(",
"boolean",
"value",
")",
"{",
"dim",
".",
"setBreakOnReturn",
"(",
"value",
")",
";",
"debugGui",
".",
"getMenubar",
"(",
")",
".",
"getBreakOnReturn",
"(",
")",
".",
"setSelected",
"(",
"value",
")",
";",
"}"
] | Sets whether execution should break when a function is left. | [
"Sets",
"whether",
"execution",
"should",
"break",
"when",
"a",
"function",
"is",
"left",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/toolsrc/org/mozilla/javascript/tools/debugger/Main.java#L77-L80 |
21,375 | mozilla/rhino | src/org/mozilla/javascript/UintMap.java | UintMap.getObject | public Object getObject(int key) {
if (key < 0) Kit.codeBug();
if (values != null) {
int index = findIndex(key);
if (0 <= index) {
return values[index];
}
}
return null;
} | java | public Object getObject(int key) {
if (key < 0) Kit.codeBug();
if (values != null) {
int index = findIndex(key);
if (0 <= index) {
return values[index];
}
}
return null;
} | [
"public",
"Object",
"getObject",
"(",
"int",
"key",
")",
"{",
"if",
"(",
"key",
"<",
"0",
")",
"Kit",
".",
"codeBug",
"(",
")",
";",
"if",
"(",
"values",
"!=",
"null",
")",
"{",
"int",
"index",
"=",
"findIndex",
"(",
"key",
")",
";",
"if",
"(",... | Get object value assigned with key.
@return key object value or null if key is absent | [
"Get",
"object",
"value",
"assigned",
"with",
"key",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/UintMap.java#L62-L71 |
21,376 | mozilla/rhino | src/org/mozilla/javascript/UintMap.java | UintMap.put | public void put(int key, Object value) {
if (key < 0) Kit.codeBug();
int index = ensureIndex(key, false);
if (values == null) {
values = new Object[1 << power];
}
values[index] = value;
} | java | public void put(int key, Object value) {
if (key < 0) Kit.codeBug();
int index = ensureIndex(key, false);
if (values == null) {
values = new Object[1 << power];
}
values[index] = value;
} | [
"public",
"void",
"put",
"(",
"int",
"key",
",",
"Object",
"value",
")",
"{",
"if",
"(",
"key",
"<",
"0",
")",
"Kit",
".",
"codeBug",
"(",
")",
";",
"int",
"index",
"=",
"ensureIndex",
"(",
"key",
",",
"false",
")",
";",
"if",
"(",
"values",
"=... | Set object value of the key.
If key does not exist, also set its int value to 0. | [
"Set",
"object",
"value",
"of",
"the",
"key",
".",
"If",
"key",
"does",
"not",
"exist",
"also",
"set",
"its",
"int",
"value",
"to",
"0",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/UintMap.java#L113-L120 |
21,377 | mozilla/rhino | src/org/mozilla/javascript/UintMap.java | UintMap.put | public void put(int key, int value) {
if (key < 0) Kit.codeBug();
int index = ensureIndex(key, true);
if (ivaluesShift == 0) {
int N = 1 << power;
// keys.length can be N * 2 after clear which set ivaluesShift to 0
if (keys.length != N * 2) {
i... | java | public void put(int key, int value) {
if (key < 0) Kit.codeBug();
int index = ensureIndex(key, true);
if (ivaluesShift == 0) {
int N = 1 << power;
// keys.length can be N * 2 after clear which set ivaluesShift to 0
if (keys.length != N * 2) {
i... | [
"public",
"void",
"put",
"(",
"int",
"key",
",",
"int",
"value",
")",
"{",
"if",
"(",
"key",
"<",
"0",
")",
"Kit",
".",
"codeBug",
"(",
")",
";",
"int",
"index",
"=",
"ensureIndex",
"(",
"key",
",",
"true",
")",
";",
"if",
"(",
"ivaluesShift",
... | Set int value of the key.
If key does not exist, also set its object value to null. | [
"Set",
"int",
"value",
"of",
"the",
"key",
".",
"If",
"key",
"does",
"not",
"exist",
"also",
"set",
"its",
"object",
"value",
"to",
"null",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/UintMap.java#L126-L140 |
21,378 | mozilla/rhino | src/org/mozilla/javascript/UintMap.java | UintMap.getKeys | public int[] getKeys() {
int[] keys = this.keys;
int n = keyCount;
int[] result = new int[n];
for (int i = 0; n != 0; ++i) {
int entry = keys[i];
if (entry != EMPTY && entry != DELETED) {
result[--n] = entry;
}
}
return ... | java | public int[] getKeys() {
int[] keys = this.keys;
int n = keyCount;
int[] result = new int[n];
for (int i = 0; n != 0; ++i) {
int entry = keys[i];
if (entry != EMPTY && entry != DELETED) {
result[--n] = entry;
}
}
return ... | [
"public",
"int",
"[",
"]",
"getKeys",
"(",
")",
"{",
"int",
"[",
"]",
"keys",
"=",
"this",
".",
"keys",
";",
"int",
"n",
"=",
"keyCount",
";",
"int",
"[",
"]",
"result",
"=",
"new",
"int",
"[",
"n",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0... | Return array of present keys | [
"Return",
"array",
"of",
"present",
"keys"
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/UintMap.java#L173-L184 |
21,379 | mozilla/rhino | src/org/mozilla/javascript/NativeSymbol.java | NativeSymbol.construct | public static NativeSymbol construct(Context cx, Scriptable scope, Object[] args)
{
cx.putThreadLocal(CONSTRUCTOR_SLOT, Boolean.TRUE);
try {
return (NativeSymbol)cx.newObject(scope, CLASS_NAME, args);
} finally {
cx.removeThreadLocal(CONSTRUCTOR_SLOT);
}
} | java | public static NativeSymbol construct(Context cx, Scriptable scope, Object[] args)
{
cx.putThreadLocal(CONSTRUCTOR_SLOT, Boolean.TRUE);
try {
return (NativeSymbol)cx.newObject(scope, CLASS_NAME, args);
} finally {
cx.removeThreadLocal(CONSTRUCTOR_SLOT);
}
} | [
"public",
"static",
"NativeSymbol",
"construct",
"(",
"Context",
"cx",
",",
"Scriptable",
"scope",
",",
"Object",
"[",
"]",
"args",
")",
"{",
"cx",
".",
"putThreadLocal",
"(",
"CONSTRUCTOR_SLOT",
",",
"Boolean",
".",
"TRUE",
")",
";",
"try",
"{",
"return",... | Use this when we need to create symbols internally because of the convoluted way we have to
construct them. | [
"Use",
"this",
"when",
"we",
"need",
"to",
"create",
"symbols",
"internally",
"because",
"of",
"the",
"convoluted",
"way",
"we",
"have",
"to",
"construct",
"them",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/NativeSymbol.java#L86-L94 |
21,380 | mozilla/rhino | src/org/mozilla/javascript/NativeSymbol.java | NativeSymbol.put | @Override
public void put(String name, Scriptable start, Object value)
{
if (!isSymbol()) {
super.put(name, start, value);
} else if (Context.getCurrentContext().isStrictMode()) {
throw ScriptRuntime.typeError0("msg.no.assign.symbol.strict");
}
} | java | @Override
public void put(String name, Scriptable start, Object value)
{
if (!isSymbol()) {
super.put(name, start, value);
} else if (Context.getCurrentContext().isStrictMode()) {
throw ScriptRuntime.typeError0("msg.no.assign.symbol.strict");
}
} | [
"@",
"Override",
"public",
"void",
"put",
"(",
"String",
"name",
",",
"Scriptable",
"start",
",",
"Object",
"value",
")",
"{",
"if",
"(",
"!",
"isSymbol",
"(",
")",
")",
"{",
"super",
".",
"put",
"(",
"name",
",",
"start",
",",
"value",
")",
";",
... | Symbol objects have a special property that one cannot add properties. | [
"Symbol",
"objects",
"have",
"a",
"special",
"property",
"that",
"one",
"cannot",
"add",
"properties",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/NativeSymbol.java#L283-L291 |
21,381 | mozilla/rhino | toolsrc/org/mozilla/javascript/tools/shell/Main.java | Main.exec | public static int exec(String origArgs[])
{
errorReporter = new ToolErrorReporter(false, global.getErr());
shellContextFactory.setErrorReporter(errorReporter);
String[] args = processOptions(origArgs);
if (exitCode > 0) {
return exitCode;
}
if (processStdi... | java | public static int exec(String origArgs[])
{
errorReporter = new ToolErrorReporter(false, global.getErr());
shellContextFactory.setErrorReporter(errorReporter);
String[] args = processOptions(origArgs);
if (exitCode > 0) {
return exitCode;
}
if (processStdi... | [
"public",
"static",
"int",
"exec",
"(",
"String",
"origArgs",
"[",
"]",
")",
"{",
"errorReporter",
"=",
"new",
"ToolErrorReporter",
"(",
"false",
",",
"global",
".",
"getErr",
"(",
")",
")",
";",
"shellContextFactory",
".",
"setErrorReporter",
"(",
"errorRep... | Execute the given arguments, but don't System.exit at the end. | [
"Execute",
"the",
"given",
"arguments",
"but",
"don",
"t",
"System",
".",
"exit",
"at",
"the",
"end",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/toolsrc/org/mozilla/javascript/tools/shell/Main.java#L145-L164 |
21,382 | mozilla/rhino | src/org/mozilla/javascript/ast/AstRoot.java | AstRoot.setComments | public void setComments(SortedSet<Comment> comments) {
if (comments == null) {
this.comments = null;
} else {
if (this.comments != null)
this.comments.clear();
for (Comment c : comments)
addComment(c);
}
} | java | public void setComments(SortedSet<Comment> comments) {
if (comments == null) {
this.comments = null;
} else {
if (this.comments != null)
this.comments.clear();
for (Comment c : comments)
addComment(c);
}
} | [
"public",
"void",
"setComments",
"(",
"SortedSet",
"<",
"Comment",
">",
"comments",
")",
"{",
"if",
"(",
"comments",
"==",
"null",
")",
"{",
"this",
".",
"comments",
"=",
"null",
";",
"}",
"else",
"{",
"if",
"(",
"this",
".",
"comments",
"!=",
"null"... | Sets comment list, and updates the parent of each entry to point
to this node. Replaces any existing comments.
@param comments comment list. can be {@code null}. | [
"Sets",
"comment",
"list",
"and",
"updates",
"the",
"parent",
"of",
"each",
"entry",
"to",
"point",
"to",
"this",
"node",
".",
"Replaces",
"any",
"existing",
"comments",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ast/AstRoot.java#L53-L62 |
21,383 | mozilla/rhino | src/org/mozilla/javascript/ast/AstRoot.java | AstRoot.addComment | public void addComment(Comment comment) {
assertNotNull(comment);
if (comments == null) {
comments = new TreeSet<Comment>(new AstNode.PositionComparator());
}
comments.add(comment);
comment.setParent(this);
} | java | public void addComment(Comment comment) {
assertNotNull(comment);
if (comments == null) {
comments = new TreeSet<Comment>(new AstNode.PositionComparator());
}
comments.add(comment);
comment.setParent(this);
} | [
"public",
"void",
"addComment",
"(",
"Comment",
"comment",
")",
"{",
"assertNotNull",
"(",
"comment",
")",
";",
"if",
"(",
"comments",
"==",
"null",
")",
"{",
"comments",
"=",
"new",
"TreeSet",
"<",
"Comment",
">",
"(",
"new",
"AstNode",
".",
"PositionCo... | Add a comment to the comment set.
@param comment the comment node.
@throws IllegalArgumentException if comment is {@code null} | [
"Add",
"a",
"comment",
"to",
"the",
"comment",
"set",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ast/AstRoot.java#L69-L76 |
21,384 | mozilla/rhino | src/org/mozilla/javascript/ast/AstRoot.java | AstRoot.checkParentLinks | public void checkParentLinks() {
this.visit(new NodeVisitor() {
@Override
public boolean visit(AstNode node) {
int type = node.getType();
if (type == Token.SCRIPT)
return true;
if (node.getParent() == null)
... | java | public void checkParentLinks() {
this.visit(new NodeVisitor() {
@Override
public boolean visit(AstNode node) {
int type = node.getType();
if (type == Token.SCRIPT)
return true;
if (node.getParent() == null)
... | [
"public",
"void",
"checkParentLinks",
"(",
")",
"{",
"this",
".",
"visit",
"(",
"new",
"NodeVisitor",
"(",
")",
"{",
"@",
"Override",
"public",
"boolean",
"visit",
"(",
"AstNode",
"node",
")",
"{",
"int",
"type",
"=",
"node",
".",
"getType",
"(",
")",
... | Debugging function to check that the parser has set the parent
link for every node in the tree.
@throws IllegalStateException if a parent link is missing | [
"Debugging",
"function",
"to",
"check",
"that",
"the",
"parser",
"has",
"set",
"the",
"parent",
"link",
"for",
"every",
"node",
"in",
"the",
"tree",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ast/AstRoot.java#L132-L146 |
21,385 | mozilla/rhino | src/org/mozilla/javascript/ast/FunctionCall.java | FunctionCall.setArguments | public void setArguments(List<AstNode> arguments) {
if (arguments == null) {
this.arguments = null;
} else {
if (this.arguments != null)
this.arguments.clear();
for (AstNode arg : arguments) {
addArgument(arg);
}
}
... | java | public void setArguments(List<AstNode> arguments) {
if (arguments == null) {
this.arguments = null;
} else {
if (this.arguments != null)
this.arguments.clear();
for (AstNode arg : arguments) {
addArgument(arg);
}
}
... | [
"public",
"void",
"setArguments",
"(",
"List",
"<",
"AstNode",
">",
"arguments",
")",
"{",
"if",
"(",
"arguments",
"==",
"null",
")",
"{",
"this",
".",
"arguments",
"=",
"null",
";",
"}",
"else",
"{",
"if",
"(",
"this",
".",
"arguments",
"!=",
"null"... | Sets function argument list
@param arguments function argument list. Can be {@code null},
in which case any existing args are removed. | [
"Sets",
"function",
"argument",
"list"
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ast/FunctionCall.java#L76-L86 |
21,386 | mozilla/rhino | src/org/mozilla/javascript/ast/FunctionCall.java | FunctionCall.addArgument | public void addArgument(AstNode arg) {
assertNotNull(arg);
if (arguments == null) {
arguments = new ArrayList<AstNode>();
}
arguments.add(arg);
arg.setParent(this);
} | java | public void addArgument(AstNode arg) {
assertNotNull(arg);
if (arguments == null) {
arguments = new ArrayList<AstNode>();
}
arguments.add(arg);
arg.setParent(this);
} | [
"public",
"void",
"addArgument",
"(",
"AstNode",
"arg",
")",
"{",
"assertNotNull",
"(",
"arg",
")",
";",
"if",
"(",
"arguments",
"==",
"null",
")",
"{",
"arguments",
"=",
"new",
"ArrayList",
"<",
"AstNode",
">",
"(",
")",
";",
"}",
"arguments",
".",
... | Adds an argument to the list, and sets its parent to this node.
@param arg the argument node to add to the list
@throws IllegalArgumentException} if arg is {@code null} | [
"Adds",
"an",
"argument",
"to",
"the",
"list",
"and",
"sets",
"its",
"parent",
"to",
"this",
"node",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ast/FunctionCall.java#L93-L100 |
21,387 | mozilla/rhino | src/org/mozilla/javascript/ast/ScriptNode.java | ScriptNode.addRegExp | public void addRegExp(RegExpLiteral re) {
if (re == null) codeBug();
if (regexps == null)
regexps = new ArrayList<RegExpLiteral>();
regexps.add(re);
re.putIntProp(REGEXP_PROP, regexps.size() - 1);
} | java | public void addRegExp(RegExpLiteral re) {
if (re == null) codeBug();
if (regexps == null)
regexps = new ArrayList<RegExpLiteral>();
regexps.add(re);
re.putIntProp(REGEXP_PROP, regexps.size() - 1);
} | [
"public",
"void",
"addRegExp",
"(",
"RegExpLiteral",
"re",
")",
"{",
"if",
"(",
"re",
"==",
"null",
")",
"codeBug",
"(",
")",
";",
"if",
"(",
"regexps",
"==",
"null",
")",
"regexps",
"=",
"new",
"ArrayList",
"<",
"RegExpLiteral",
">",
"(",
")",
";",
... | Called by IRFactory to add a RegExp to the regexp table. | [
"Called",
"by",
"IRFactory",
"to",
"add",
"a",
"RegExp",
"to",
"the",
"regexp",
"table",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ast/ScriptNode.java#L202-L208 |
21,388 | mozilla/rhino | src/org/mozilla/javascript/ast/ScriptNode.java | ScriptNode.flattenSymbolTable | public void flattenSymbolTable(boolean flattenAllTables) {
if (!flattenAllTables) {
List<Symbol> newSymbols = new ArrayList<Symbol>();
if (this.symbolTable != null) {
// Just replace "symbols" with the symbols in this object's
// symbol table. Can't just w... | java | public void flattenSymbolTable(boolean flattenAllTables) {
if (!flattenAllTables) {
List<Symbol> newSymbols = new ArrayList<Symbol>();
if (this.symbolTable != null) {
// Just replace "symbols" with the symbols in this object's
// symbol table. Can't just w... | [
"public",
"void",
"flattenSymbolTable",
"(",
"boolean",
"flattenAllTables",
")",
"{",
"if",
"(",
"!",
"flattenAllTables",
")",
"{",
"List",
"<",
"Symbol",
">",
"newSymbols",
"=",
"new",
"ArrayList",
"<",
"Symbol",
">",
"(",
")",
";",
"if",
"(",
"this",
"... | Assign every symbol a unique integer index. Generate arrays of variable
names and constness that can be indexed by those indices.
@param flattenAllTables if true, flatten all symbol tables,
included nested block scope symbol tables. If false, just flatten the
script's or function's symbol table. | [
"Assign",
"every",
"symbol",
"a",
"unique",
"integer",
"index",
".",
"Generate",
"arrays",
"of",
"variable",
"names",
"and",
"constness",
"that",
"can",
"be",
"indexed",
"by",
"those",
"indices",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ast/ScriptNode.java#L267-L291 |
21,389 | mozilla/rhino | src/org/mozilla/javascript/ast/LabeledStatement.java | LabeledStatement.setLabels | public void setLabels(List<Label> labels) {
assertNotNull(labels);
if (this.labels != null)
this.labels.clear();
for (Label l : labels) {
addLabel(l);
}
} | java | public void setLabels(List<Label> labels) {
assertNotNull(labels);
if (this.labels != null)
this.labels.clear();
for (Label l : labels) {
addLabel(l);
}
} | [
"public",
"void",
"setLabels",
"(",
"List",
"<",
"Label",
">",
"labels",
")",
"{",
"assertNotNull",
"(",
"labels",
")",
";",
"if",
"(",
"this",
".",
"labels",
"!=",
"null",
")",
"this",
".",
"labels",
".",
"clear",
"(",
")",
";",
"for",
"(",
"Label... | Sets label list, setting the parent of each label
in the list. Replaces any existing labels.
@throws IllegalArgumentException} if labels is {@code null} | [
"Sets",
"label",
"list",
"setting",
"the",
"parent",
"of",
"each",
"label",
"in",
"the",
"list",
".",
"Replaces",
"any",
"existing",
"labels",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ast/LabeledStatement.java#L53-L60 |
21,390 | mozilla/rhino | src/org/mozilla/javascript/ast/LabeledStatement.java | LabeledStatement.addLabel | public void addLabel(Label label) {
assertNotNull(label);
labels.add(label);
label.setParent(this);
} | java | public void addLabel(Label label) {
assertNotNull(label);
labels.add(label);
label.setParent(this);
} | [
"public",
"void",
"addLabel",
"(",
"Label",
"label",
")",
"{",
"assertNotNull",
"(",
"label",
")",
";",
"labels",
".",
"add",
"(",
"label",
")",
";",
"label",
".",
"setParent",
"(",
"this",
")",
";",
"}"
] | Adds a label and sets its parent to this node.
@throws IllegalArgumentException} if label is {@code null} | [
"Adds",
"a",
"label",
"and",
"sets",
"its",
"parent",
"to",
"this",
"node",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ast/LabeledStatement.java#L66-L70 |
21,391 | mozilla/rhino | src/org/mozilla/javascript/ast/LabeledStatement.java | LabeledStatement.visit | @Override
public void visit(NodeVisitor v) {
if (v.visit(this)) {
for (AstNode label : labels) {
label.visit(v);
}
statement.visit(v);
}
} | java | @Override
public void visit(NodeVisitor v) {
if (v.visit(this)) {
for (AstNode label : labels) {
label.visit(v);
}
statement.visit(v);
}
} | [
"@",
"Override",
"public",
"void",
"visit",
"(",
"NodeVisitor",
"v",
")",
"{",
"if",
"(",
"v",
".",
"visit",
"(",
"this",
")",
")",
"{",
"for",
"(",
"AstNode",
"label",
":",
"labels",
")",
"{",
"label",
".",
"visit",
"(",
"v",
")",
";",
"}",
"s... | Visits this node, then each label in the label-list, and finally the
statement. | [
"Visits",
"this",
"node",
"then",
"each",
"label",
"in",
"the",
"label",
"-",
"list",
"and",
"finally",
"the",
"statement",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ast/LabeledStatement.java#L127-L135 |
21,392 | mozilla/rhino | src/org/mozilla/javascript/ast/XmlLiteral.java | XmlLiteral.setFragments | public void setFragments(List<XmlFragment> fragments) {
assertNotNull(fragments);
this.fragments.clear();
for (XmlFragment fragment : fragments)
addFragment(fragment);
} | java | public void setFragments(List<XmlFragment> fragments) {
assertNotNull(fragments);
this.fragments.clear();
for (XmlFragment fragment : fragments)
addFragment(fragment);
} | [
"public",
"void",
"setFragments",
"(",
"List",
"<",
"XmlFragment",
">",
"fragments",
")",
"{",
"assertNotNull",
"(",
"fragments",
")",
";",
"this",
".",
"fragments",
".",
"clear",
"(",
")",
";",
"for",
"(",
"XmlFragment",
"fragment",
":",
"fragments",
")",... | Sets fragment list, removing any existing fragments first.
Sets the parent pointer for each fragment in the list to this node.
@param fragments fragment list. Replaces any existing fragments.
@throws IllegalArgumentException} if {@code fragments} is {@code null} | [
"Sets",
"fragment",
"list",
"removing",
"any",
"existing",
"fragments",
"first",
".",
"Sets",
"the",
"parent",
"pointer",
"for",
"each",
"fragment",
"in",
"the",
"list",
"to",
"this",
"node",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ast/XmlLiteral.java#L53-L58 |
21,393 | mozilla/rhino | src/org/mozilla/javascript/ast/XmlLiteral.java | XmlLiteral.addFragment | public void addFragment(XmlFragment fragment) {
assertNotNull(fragment);
fragments.add(fragment);
fragment.setParent(this);
} | java | public void addFragment(XmlFragment fragment) {
assertNotNull(fragment);
fragments.add(fragment);
fragment.setParent(this);
} | [
"public",
"void",
"addFragment",
"(",
"XmlFragment",
"fragment",
")",
"{",
"assertNotNull",
"(",
"fragment",
")",
";",
"fragments",
".",
"add",
"(",
"fragment",
")",
";",
"fragment",
".",
"setParent",
"(",
"this",
")",
";",
"}"
] | Adds a fragment to the fragment list. Sets its parent to this node.
@throws IllegalArgumentException} if {@code fragment} is {@code null} | [
"Adds",
"a",
"fragment",
"to",
"the",
"fragment",
"list",
".",
"Sets",
"its",
"parent",
"to",
"this",
"node",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ast/XmlLiteral.java#L64-L68 |
21,394 | mozilla/rhino | src/org/mozilla/javascript/ast/XmlLiteral.java | XmlLiteral.visit | @Override
public void visit(NodeVisitor v) {
if (v.visit(this)) {
for (XmlFragment frag : fragments) {
frag.visit(v);
}
}
} | java | @Override
public void visit(NodeVisitor v) {
if (v.visit(this)) {
for (XmlFragment frag : fragments) {
frag.visit(v);
}
}
} | [
"@",
"Override",
"public",
"void",
"visit",
"(",
"NodeVisitor",
"v",
")",
"{",
"if",
"(",
"v",
".",
"visit",
"(",
"this",
")",
")",
"{",
"for",
"(",
"XmlFragment",
"frag",
":",
"fragments",
")",
"{",
"frag",
".",
"visit",
"(",
"v",
")",
";",
"}",... | Visits this node, then visits each child fragment in lexical order. | [
"Visits",
"this",
"node",
"then",
"visits",
"each",
"child",
"fragment",
"in",
"lexical",
"order",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ast/XmlLiteral.java#L82-L89 |
21,395 | mozilla/rhino | src/org/mozilla/javascript/ast/AstNode.java | AstNode.getAbsolutePosition | public int getAbsolutePosition() {
int pos = position;
AstNode parent = this.parent;
while (parent != null) {
pos += parent.getPosition();
parent = parent.getParent();
}
return pos;
} | java | public int getAbsolutePosition() {
int pos = position;
AstNode parent = this.parent;
while (parent != null) {
pos += parent.getPosition();
parent = parent.getParent();
}
return pos;
} | [
"public",
"int",
"getAbsolutePosition",
"(",
")",
"{",
"int",
"pos",
"=",
"position",
";",
"AstNode",
"parent",
"=",
"this",
".",
"parent",
";",
"while",
"(",
"parent",
"!=",
"null",
")",
"{",
"pos",
"+=",
"parent",
".",
"getPosition",
"(",
")",
";",
... | Returns the absolute document position of the node.
Computes it by adding the node's relative position
to the relative positions of all its parents. | [
"Returns",
"the",
"absolute",
"document",
"position",
"of",
"the",
"node",
".",
"Computes",
"it",
"by",
"adding",
"the",
"node",
"s",
"relative",
"position",
"to",
"the",
"relative",
"positions",
"of",
"all",
"its",
"parents",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ast/AstNode.java#L194-L202 |
21,396 | mozilla/rhino | src/org/mozilla/javascript/ast/AstNode.java | AstNode.setParent | public void setParent(AstNode parent) {
if (parent == this.parent) {
return;
}
// Convert position back to absolute.
if (this.parent != null) {
setRelative(-this.parent.getAbsolutePosition());
}
this.parent = parent;
if (parent != null) {... | java | public void setParent(AstNode parent) {
if (parent == this.parent) {
return;
}
// Convert position back to absolute.
if (this.parent != null) {
setRelative(-this.parent.getAbsolutePosition());
}
this.parent = parent;
if (parent != null) {... | [
"public",
"void",
"setParent",
"(",
"AstNode",
"parent",
")",
"{",
"if",
"(",
"parent",
"==",
"this",
".",
"parent",
")",
"{",
"return",
";",
"}",
"// Convert position back to absolute.",
"if",
"(",
"this",
".",
"parent",
"!=",
"null",
")",
"{",
"setRelati... | Sets the node parent. This method automatically adjusts the
current node's start position to be relative to the new parent.
@param parent the new parent. Can be {@code null}. | [
"Sets",
"the",
"node",
"parent",
".",
"This",
"method",
"automatically",
"adjusts",
"the",
"current",
"node",
"s",
"start",
"position",
"to",
"be",
"relative",
"to",
"the",
"new",
"parent",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ast/AstNode.java#L250-L264 |
21,397 | mozilla/rhino | src/org/mozilla/javascript/ast/AstNode.java | AstNode.addChild | public void addChild(AstNode kid) {
assertNotNull(kid);
int end = kid.getPosition() + kid.getLength();
setLength(end - this.getPosition());
addChildToBack(kid);
kid.setParent(this);
} | java | public void addChild(AstNode kid) {
assertNotNull(kid);
int end = kid.getPosition() + kid.getLength();
setLength(end - this.getPosition());
addChildToBack(kid);
kid.setParent(this);
} | [
"public",
"void",
"addChild",
"(",
"AstNode",
"kid",
")",
"{",
"assertNotNull",
"(",
"kid",
")",
";",
"int",
"end",
"=",
"kid",
".",
"getPosition",
"(",
")",
"+",
"kid",
".",
"getLength",
"(",
")",
";",
"setLength",
"(",
"end",
"-",
"this",
".",
"g... | Adds a child or function to the end of the block.
Sets the parent of the child to this node, and fixes up
the start position of the child to be relative to this node.
Sets the length of this node to include the new child.
@param kid the child
@throws IllegalArgumentException if kid is {@code null} | [
"Adds",
"a",
"child",
"or",
"function",
"to",
"the",
"end",
"of",
"the",
"block",
".",
"Sets",
"the",
"parent",
"of",
"the",
"child",
"to",
"this",
"node",
"and",
"fixes",
"up",
"the",
"start",
"position",
"of",
"the",
"child",
"to",
"be",
"relative",
... | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ast/AstNode.java#L274-L280 |
21,398 | mozilla/rhino | src/org/mozilla/javascript/ast/AstNode.java | AstNode.getAstRoot | public AstRoot getAstRoot() {
AstNode parent = this; // this node could be the AstRoot
while (parent != null && !(parent instanceof AstRoot)) {
parent = parent.getParent();
}
return (AstRoot)parent;
} | java | public AstRoot getAstRoot() {
AstNode parent = this; // this node could be the AstRoot
while (parent != null && !(parent instanceof AstRoot)) {
parent = parent.getParent();
}
return (AstRoot)parent;
} | [
"public",
"AstRoot",
"getAstRoot",
"(",
")",
"{",
"AstNode",
"parent",
"=",
"this",
";",
"// this node could be the AstRoot",
"while",
"(",
"parent",
"!=",
"null",
"&&",
"!",
"(",
"parent",
"instanceof",
"AstRoot",
")",
")",
"{",
"parent",
"=",
"parent",
"."... | Returns the root of the tree containing this node.
@return the {@link AstRoot} at the root of this node's parent
chain, or {@code null} if the topmost parent is not an {@code AstRoot}. | [
"Returns",
"the",
"root",
"of",
"the",
"tree",
"containing",
"this",
"node",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ast/AstNode.java#L287-L293 |
21,399 | mozilla/rhino | src/org/mozilla/javascript/ast/AstNode.java | AstNode.shortName | public String shortName() {
String classname = getClass().getName();
int last = classname.lastIndexOf(".");
return classname.substring(last + 1);
} | java | public String shortName() {
String classname = getClass().getName();
int last = classname.lastIndexOf(".");
return classname.substring(last + 1);
} | [
"public",
"String",
"shortName",
"(",
")",
"{",
"String",
"classname",
"=",
"getClass",
"(",
")",
".",
"getName",
"(",
")",
";",
"int",
"last",
"=",
"classname",
".",
"lastIndexOf",
"(",
"\".\"",
")",
";",
"return",
"classname",
".",
"substring",
"(",
... | Returns a short, descriptive name for the node, such as
"ArrayComprehension". | [
"Returns",
"a",
"short",
"descriptive",
"name",
"for",
"the",
"node",
"such",
"as",
"ArrayComprehension",
"."
] | fa8a86df11d37623f5faa8d445a5876612bc47b0 | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ast/AstNode.java#L334-L338 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.