示例#1
0
 CloneSerializer(ExecState* exec, MessagePortArray* messagePorts, Vector<uint8_t>& out)
     : CloneBase(exec)
     , m_buffer(out)
     , m_emptyIdentifier(exec, UString("", 0))
 {
     write(CurrentVersion);
     if (messagePorts) {
         JSDOMGlobalObject* globalObject = static_cast<JSDOMGlobalObject*>(exec->lexicalGlobalObject());
         for (size_t i = 0; i < messagePorts->size(); i++) {
             JSC::JSValue value = toJS(exec, globalObject, messagePorts->at(i).get());
             if (value.getObject())
                 m_transferredMessagePorts.add(value.getObject(), i);
         }
     }
 }
PassRefPtr<JSCustomXPathNSResolver> JSCustomXPathNSResolver::create(JSC::ExecState* exec, JSC::JSValue value)
{
    if (value.isUndefinedOrNull())
        return 0;

    JSObject* resolverObject = value.getObject();
    if (!resolverObject) {
        setDOMException(exec, TYPE_MISMATCH_ERR);
        return 0;
    }

    return adoptRef(new JSCustomXPathNSResolver(resolverObject, asJSDOMWindow(exec->dynamicGlobalObject())));
}
示例#3
0
Dictionary::Dictionary(JSC::ExecState* exec, JSC::JSValue value)
    : m_dictionary(exec, value.isObject() ? value.getObject() : 0)
{
}