本文整理汇总了Java中org.mozilla.javascript.IdFunctionObject类的典型用法代码示例。如果您正苦于以下问题:Java IdFunctionObject类的具体用法?Java IdFunctionObject怎么用?Java IdFunctionObject使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IdFunctionObject类属于org.mozilla.javascript包,在下文中一共展示了IdFunctionObject类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: execIdCall
import org.mozilla.javascript.IdFunctionObject; //导入依赖的package包/类
@Override
public Object execIdCall(IdFunctionObject f, Context cx, Scriptable scope,
Scriptable thisObj, Object[] args)
{
if (!f.hasTag(CLASS_NAME)) {
return super.execIdCall(f, cx, scope, thisObj, args);
}
int id = f.methodId();
switch (id) {
case ConstructorId_isView:
return (isArg(args, 0) && (args[0] instanceof NativeArrayBufferView));
case Id_constructor:
int length = isArg(args, 0) ? ScriptRuntime.toInt32(args[0]) : 0;
return new NativeArrayBuffer(length);
case Id_slice:
NativeArrayBuffer self = realThis(thisObj, f);
int start = isArg(args, 0) ? ScriptRuntime.toInt32(args[0]) : 0;
int end = isArg(args, 1) ? ScriptRuntime.toInt32(args[1]) : self.buffer.length;
return self.slice(start, end);
}
throw new IllegalArgumentException(String.valueOf(id));
}
示例2: realThis
import org.mozilla.javascript.IdFunctionObject; //导入依赖的package包/类
@Override
protected NativeTypedArrayView realThis(Scriptable thisObj, IdFunctionObject f)
{
if (!(thisObj instanceof NativeInt16Array)) {
throw incompatibleCallError(f);
}
return (NativeInt16Array)thisObj;
}
示例3: realThis
import org.mozilla.javascript.IdFunctionObject; //导入依赖的package包/类
@Override
protected NativeTypedArrayView realThis(Scriptable thisObj, IdFunctionObject f)
{
if (!(thisObj instanceof NativeUint8Array)) {
throw incompatibleCallError(f);
}
return (NativeUint8Array)thisObj;
}
示例4: realThis
import org.mozilla.javascript.IdFunctionObject; //导入依赖的package包/类
@Override
protected NativeTypedArrayView realThis(Scriptable thisObj, IdFunctionObject f)
{
if (!(thisObj instanceof NativeFloat64Array)) {
throw incompatibleCallError(f);
}
return (NativeFloat64Array)thisObj;
}
示例5: realThis
import org.mozilla.javascript.IdFunctionObject; //导入依赖的package包/类
@Override
protected NativeTypedArrayView realThis(Scriptable thisObj, IdFunctionObject f)
{
if (!(thisObj instanceof NativeUint32Array)) {
throw incompatibleCallError(f);
}
return (NativeUint32Array)thisObj;
}
示例6: realThis
import org.mozilla.javascript.IdFunctionObject; //导入依赖的package包/类
@Override
protected NativeTypedArrayView realThis(Scriptable thisObj, IdFunctionObject f)
{
if (!(thisObj instanceof NativeUint16Array)) {
throw incompatibleCallError(f);
}
return (NativeUint16Array)thisObj;
}
示例7: realThis
import org.mozilla.javascript.IdFunctionObject; //导入依赖的package包/类
@Override
protected NativeTypedArrayView realThis(Scriptable thisObj, IdFunctionObject f)
{
if (!(thisObj instanceof NativeUint8ClampedArray)) {
throw incompatibleCallError(f);
}
return (NativeUint8ClampedArray)thisObj;
}
示例8: realThis
import org.mozilla.javascript.IdFunctionObject; //导入依赖的package包/类
@Override
protected NativeTypedArrayView realThis(Scriptable thisObj, IdFunctionObject f)
{
if (!(thisObj instanceof NativeInt32Array)) {
throw incompatibleCallError(f);
}
return (NativeInt32Array)thisObj;
}
示例9: realThis
import org.mozilla.javascript.IdFunctionObject; //导入依赖的package包/类
@Override
protected NativeTypedArrayView realThis(Scriptable thisObj, IdFunctionObject f)
{
if (!(thisObj instanceof NativeInt8Array)) {
throw incompatibleCallError(f);
}
return (NativeInt8Array)thisObj;
}
示例10: realThis
import org.mozilla.javascript.IdFunctionObject; //导入依赖的package包/类
@Override
protected NativeTypedArrayView realThis(Scriptable thisObj, IdFunctionObject f)
{
if (!(thisObj instanceof NativeFloat32Array)) {
throw incompatibleCallError(f);
}
return (NativeFloat32Array)thisObj;
}
示例11: execIdCall
import org.mozilla.javascript.IdFunctionObject; //导入依赖的package包/类
@Override
public Object execIdCall(IdFunctionObject f, Context cx, Scriptable scope,
Scriptable thisObj, Object[] args)
{
if (!f.hasTag(REGEXP_TAG)) {
return super.execIdCall(f, cx, scope, thisObj, args);
}
int id = f.methodId();
switch (id) {
case Id_compile:
return realThis(thisObj, f).compile(cx, scope, args);
case Id_toString:
case Id_toSource:
return realThis(thisObj, f).toString();
case Id_exec:
return realThis(thisObj, f).execSub(cx, scope, args, MATCH);
case Id_test: {
Object x = realThis(thisObj, f).execSub(cx, scope, args, TEST);
return Boolean.TRUE.equals(x) ? Boolean.TRUE : Boolean.FALSE;
}
case Id_prefix:
return realThis(thisObj, f).execSub(cx, scope, args, PREFIX);
}
throw new IllegalArgumentException(String.valueOf(id));
}
示例12: contributeToScope
import org.mozilla.javascript.IdFunctionObject; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public void contributeToScope(final Object scope, final boolean trustworthyScript, final boolean mutableScope)
{
if (scope instanceof Scriptable)
{
final IdFunctionObject func = new IdFunctionObject(this, EXECUTE_BATCH_FUNC_TAG, EXECUTE_BATCH_FUNC_ID,
EXECUTE_BATCH_FUNC_NAME, ARITY, (Scriptable) scope);
func.sealObject();
// export as read-only and undeleteable property of the scope
ScriptableObject.defineProperty((Scriptable) scope, EXECUTE_BATCH_FUNC_NAME, func, ScriptableObject.PERMANENT
| ScriptableObject.READONLY);
}
}
开发者ID:AFaust,项目名称:alfresco-enhanced-script-environment,代码行数:18,代码来源:AbstractExecuteBatchFunction.java
示例13: exportFunction
import org.mozilla.javascript.IdFunctionObject; //导入依赖的package包/类
protected void exportFunction(final int methodId, final String name, final int arity, final Scriptable scope)
{
final IdFunctionObject func = new IdFunctionObject(this, LOG_FUNC_TAG, methodId, name, arity, scope);
func.sealObject();
// export as read-only and undeleteable property of the scope
ScriptableObject.defineProperty(scope, name, func, ScriptableObject.PERMANENT | ScriptableObject.READONLY);
}
示例14: contributeToScope
import org.mozilla.javascript.IdFunctionObject; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public void contributeToScope(final Object scope, final boolean trustworthyScript, final boolean mutableScope)
{
if (scope instanceof Scriptable)
{
final IdFunctionObject func = new IdFunctionObject(this, IMPORT_FUNC_TAG, IMPORT_FUNC_ID, IMPORT_FUNC_NAME, ARITY,
(Scriptable) scope);
func.sealObject();
// export as read-only and undeleteable property of the scope
ScriptableObject.defineProperty((Scriptable) scope, IMPORT_FUNC_NAME, func, ScriptableObject.PERMANENT
| ScriptableObject.READONLY);
}
}
示例15: realThis
import org.mozilla.javascript.IdFunctionObject; //导入依赖的package包/类
private static NativeArrayBuffer realThis(Scriptable thisObj, IdFunctionObject f)
{
if (!(thisObj instanceof NativeArrayBuffer))
throw incompatibleCallError(f);
return (NativeArrayBuffer)thisObj;
}