本文整理汇总了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));
}
示例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));
}
示例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));
}
示例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);
}
}
示例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;
}
示例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;
}
示例7: isEnumerable
import jdk.nashorn.internal.runtime.JSType; //导入方法依赖的package包/类
@Override
public boolean isEnumerable() {
return JSType.toBoolean(enumerable);
}
示例8: isFrozen
import jdk.nashorn.internal.runtime.JSType; //导入方法依赖的package包/类
@Override
public boolean isFrozen() {
return JSType.toBoolean(callAdaptee(Boolean.FALSE, __isFrozen__));
}
示例9: isSealed
import jdk.nashorn.internal.runtime.JSType; //导入方法依赖的package包/类
@Override
public boolean isSealed() {
return JSType.toBoolean(callAdaptee(Boolean.FALSE, __isSealed__));
}
示例10: isExtensible
import jdk.nashorn.internal.runtime.JSType; //导入方法依赖的package包/类
@Override
public boolean isExtensible() {
return JSType.toBoolean(callAdaptee(Boolean.TRUE, __isExtensible__));
}
示例11: isConfigurable
import jdk.nashorn.internal.runtime.JSType; //导入方法依赖的package包/类
@Override
public boolean isConfigurable() {
return JSType.toBoolean(configurable);
}
示例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);
}
示例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);
}