當前位置: 首頁>>代碼示例>>Java>>正文


Java GlobalObject類代碼示例

本文整理匯總了Java中jdk.nashorn.internal.runtime.GlobalObject的典型用法代碼示例。如果您正苦於以下問題:Java GlobalObject類的具體用法?Java GlobalObject怎麽用?Java GlobalObject使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


GlobalObject類屬於jdk.nashorn.internal.runtime包,在下文中一共展示了GlobalObject類的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: globalFromMirror

import jdk.nashorn.internal.runtime.GlobalObject; //導入依賴的package包/類
private ScriptObject globalFromMirror(final ScriptObjectMirror mirror) {
    ScriptObject sobj = mirror.getScriptObject();
    if (sobj instanceof GlobalObject && isOfContext(sobj, nashornContext)) {
        return sobj;
    }

    return null;
}
 
開發者ID:RedlineResearch,項目名稱:OLD-OpenJDK8,代碼行數:9,代碼來源:NashornScriptEngine.java

示例2: setContextVariables

import jdk.nashorn.internal.runtime.GlobalObject; //導入依賴的package包/類
private void setContextVariables(final ScriptObject ctxtGlobal, final ScriptContext ctxt) {
    // set "context" global variable via contextProperty - because this
    // property is non-writable
    contextProperty.setObjectValue(ctxtGlobal, ctxtGlobal, ctxt, false);
    Object args = ScriptObjectMirror.unwrap(ctxt.getAttribute("arguments"), ctxtGlobal);
    if (args == null || args == UNDEFINED) {
        args = ScriptRuntime.EMPTY_ARRAY;
    }
    // if no arguments passed, expose it
    if (! (args instanceof ScriptObject)) {
        args = ((GlobalObject)ctxtGlobal).wrapAsObject(args);
        ctxtGlobal.set("arguments", args, false);
    }
}
 
開發者ID:RedlineResearch,項目名稱:OLD-OpenJDK8,代碼行數:15,代碼來源:NashornScriptEngine.java

示例3: getGuardedInvocation

import jdk.nashorn.internal.runtime.GlobalObject; //導入依賴的package包/類
@Override
public GuardedInvocation getGuardedInvocation(final LinkRequest origRequest, final LinkerServices linkerServices)
        throws Exception {
    final LinkRequest request = origRequest.withoutRuntimeContext(); // Nashorn has no runtime context

    final Object self = request.getReceiver();
    final GlobalObject global = (GlobalObject) Context.getGlobal();
    final NashornCallSiteDescriptor desc = (NashornCallSiteDescriptor) request.getCallSiteDescriptor();

    return Bootstrap.asType(global.primitiveLookup(request, self), linkerServices, desc);
}
 
開發者ID:RedlineResearch,項目名稱:OLD-OpenJDK8,代碼行數:12,代碼來源:NashornPrimitiveLinker.java

示例4: getDescriptor

import jdk.nashorn.internal.runtime.GlobalObject; //導入依賴的package包/類
@Override
public PropertyDescriptor getDescriptor(final GlobalObject global, final int index) {
    return global.newDataDescriptor(getObject(index), false, true, false);
}
 
開發者ID:RedlineResearch,項目名稱:OLD-OpenJDK8,代碼行數:5,代碼來源:FrozenArrayFilter.java

示例5: getDescriptor

import jdk.nashorn.internal.runtime.GlobalObject; //導入依賴的package包/類
@Override
public PropertyDescriptor getDescriptor(final GlobalObject global, final int index) {
    return global.newDataDescriptor(getObject(index), false, true, true);
}
 
開發者ID:RedlineResearch,項目名稱:OLD-OpenJDK8,代碼行數:5,代碼來源:SealedArrayFilter.java

示例6: getDescriptor

import jdk.nashorn.internal.runtime.GlobalObject; //導入依賴的package包/類
/**
 * Returns property descriptor for element at a given index
 *
 * @param global the global object
 * @param index  the index
 *
 * @return property descriptor for element
 */
public PropertyDescriptor getDescriptor(final GlobalObject global, final int index) {
    return global.newDataDescriptor(getObject(index), true, true, true);
}
 
開發者ID:RedlineResearch,項目名稱:OLD-OpenJDK8,代碼行數:12,代碼來源:ArrayData.java


注:本文中的jdk.nashorn.internal.runtime.GlobalObject類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。