当前位置: 首页>>代码示例>>Java>>正文


Java JSType.toBoolean方法代码示例

本文整理汇总了Java中jdk.nashorn.internal.runtime.JSType.toBoolean方法的典型用法代码示例。如果您正苦于以下问题:Java JSType.toBoolean方法的具体用法?Java JSType.toBoolean怎么用?Java JSType.toBoolean使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在jdk.nashorn.internal.runtime.JSType的用法示例。


在下文中一共展示了JSType.toBoolean方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: has

import jdk.nashorn.internal.runtime.JSType; //导入方法依赖的package包/类
@Override
public boolean has(final Object key) {
    if (overrides && super.hasOwnProperty(key)) {
        return true;
    }

    return JSType.toBoolean(callAdaptee(Boolean.FALSE, __has__, key));
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:9,代码来源:NativeJSAdapter.java

示例2: has

import jdk.nashorn.internal.runtime.JSType; //导入方法依赖的package包/类
@Override
public boolean has(final int key) {
    if (overrides && super.hasOwnProperty(key)) {
        return true;
    }

    return JSType.toBoolean(callAdaptee(Boolean.FALSE, __has__, key));
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:9,代码来源:NativeJSAdapter.java

示例3: delete

import jdk.nashorn.internal.runtime.JSType; //导入方法依赖的package包/类
@Override
public boolean delete(final double key, final boolean strict) {
    if (overrides && super.hasOwnProperty(key)) {
        return super.delete(key, strict);
    }

    return JSType.toBoolean(callAdaptee(Boolean.TRUE, __delete__, key, strict));
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:9,代码来源:NativeJSAdapter.java

示例4: iterate

import jdk.nashorn.internal.runtime.JSType; //导入方法依赖的package包/类
/**
 * Iterate over an iterable object, passing every value to {@code consumer}.
 *
 * @param iterable an iterable object
 * @param global the current global
 * @param consumer the value consumer
 */
public static void iterate(final Object iterable, final Global global, final Consumer<Object> consumer) {

    final Object iterator = AbstractIterator.getIterator(Global.toObject(iterable), global);

    final InvokeByName nextInvoker = getNextInvoker(global);
    final MethodHandle doneInvoker = getDoneInvoker(global);
    final MethodHandle valueInvoker = getValueInvoker(global);

    try {
        do {
            final Object next = nextInvoker.getGetter().invokeExact(iterator);
            if (!Bootstrap.isCallable(next)) {
                break;
            }

            final Object result = nextInvoker.getInvoker().invokeExact(next, iterator, (Object) null);
            if (!(result instanceof ScriptObject)) {
                break;
            }

            final Object done = doneInvoker.invokeExact(result);
            if (JSType.toBoolean(done)) {
                break;
            }

            consumer.accept(valueInvoker.invokeExact(result));

        } while (true);

    } catch (final RuntimeException r) {
        throw r;
    } catch (final Throwable t) {
        throw new RuntimeException(t);
    }

}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:44,代码来源:AbstractIterator.java

示例5: constructor

import jdk.nashorn.internal.runtime.JSType; //导入方法依赖的package包/类
/**
 * ECMA 15.6.2.1 new Boolean (value)
 *
 * @param newObj is the new operator used to instantiate this NativeBoolean
 * @param self   self reference
 * @param value  value of boolean
 * @return the new NativeBoolean
 */
@Constructor(arity = 1)
public static Object constructor(final boolean newObj, final Object self, final Object value) {
    final boolean flag = JSType.toBoolean(value);

    if (newObj) {
        return new NativeBoolean(flag);
    }

    return flag;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:19,代码来源:NativeBoolean.java

示例6: fillFrom

import jdk.nashorn.internal.runtime.JSType; //导入方法依赖的package包/类
@Override
public PropertyDescriptor fillFrom(final ScriptObject sobj) {
    if (sobj.has(CONFIGURABLE)) {
        this.configurable = JSType.toBoolean(sobj.get(CONFIGURABLE));
    } else {
        delete(CONFIGURABLE, false);
    }

    if (sobj.has(ENUMERABLE)) {
        this.enumerable = JSType.toBoolean(sobj.get(ENUMERABLE));
    } else {
        delete(ENUMERABLE, false);
    }

    if (sobj.has(WRITABLE)) {
        this.writable = JSType.toBoolean(sobj.get(WRITABLE));
    } else {
        delete(WRITABLE, false);
    }

    if (sobj.has(VALUE)) {
        this.value = sobj.get(VALUE);
    } else {
        delete(VALUE, false);
    }

    return this;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:29,代码来源:DataPropertyDescriptor.java

示例7: isEnumerable

import jdk.nashorn.internal.runtime.JSType; //导入方法依赖的package包/类
@Override
public boolean isEnumerable() {
    return JSType.toBoolean(enumerable);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:5,代码来源:AccessorPropertyDescriptor.java

示例8: isFrozen

import jdk.nashorn.internal.runtime.JSType; //导入方法依赖的package包/类
@Override
public boolean isFrozen() {
    return JSType.toBoolean(callAdaptee(Boolean.FALSE, __isFrozen__));
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:5,代码来源:NativeJSAdapter.java

示例9: isSealed

import jdk.nashorn.internal.runtime.JSType; //导入方法依赖的package包/类
@Override
public boolean isSealed() {
    return JSType.toBoolean(callAdaptee(Boolean.FALSE, __isSealed__));
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:5,代码来源:NativeJSAdapter.java

示例10: isExtensible

import jdk.nashorn.internal.runtime.JSType; //导入方法依赖的package包/类
@Override
public boolean isExtensible() {
    return JSType.toBoolean(callAdaptee(Boolean.TRUE, __isExtensible__));
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:5,代码来源:NativeJSAdapter.java

示例11: isConfigurable

import jdk.nashorn.internal.runtime.JSType; //导入方法依赖的package包/类
@Override
public boolean isConfigurable() {
    return JSType.toBoolean(configurable);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:5,代码来源:AccessorPropertyDescriptor.java

示例12: getBoolean

import jdk.nashorn.internal.runtime.JSType; //导入方法依赖的package包/类
/**
 * Fetch boolean value of node.
 *
 * @return boolean value of node.
 */
public boolean getBoolean() {
    return JSType.toBoolean(value);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:9,代码来源:LiteralNode.java

示例13: isTrue

import jdk.nashorn.internal.runtime.JSType; //导入方法依赖的package包/类
/**
 * Check if the literal value is boolean true
 * @return true if literal value is boolean true
 */
public boolean isTrue() {
    return JSType.toBoolean(value);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:8,代码来源:LiteralNode.java


注:本文中的jdk.nashorn.internal.runtime.JSType.toBoolean方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。