in src/main/java/org/apache/sling/scripting/javascript/helper/SlingGlobal.java [81:108]
public static void init(Scriptable scope, boolean sealed) {
SlingGlobal obj = new SlingGlobal();
for (int id = 1; id <= LAST_SCOPE_FUNCTION_ID; ++id) {
String name;
int arity = 1;
switch (id) {
case Id_load:
name = "load";
break;
case Id_print:
name = "print";
break;
case Id_require:
name = "require";
break;
default:
throw Kit.codeBug();
}
IdFunctionObject f = new IdFunctionObject(obj, FTAG, id, name,
arity, scope);
if (sealed) {
f.sealObject();
}
f.exportAsScopeProperty();
}
}