コード例 #1
0
ファイル: JSProxy.cpp プロジェクト: dog-god/iptv
void JSProxy::setTarget(JSGlobalData& globalData, JSGlobalObject* globalObject)
{
    ASSERT_ARG(globalObject, globalObject);
    m_target.set(globalData, this, globalObject);
    setPrototype(globalData, globalObject->prototype());
    resetInheritorID(globalData);
}
コード例 #2
0
void DataSourceView::createDirectory()
{
	QFileInfo fi = currentFileInfo();
	CreateDirectoryDialog dlg(fi.absoluteFilePath());

	if (dlg.exec() != QDialog::Accepted)
		return;

	if (QFile::exists(fi.absoluteFilePath() + "/" + dlg.name()))
	{
		QMessageBox::warning(
			this,
			tr("Directory exists"),
			tr("Directory %1 already exists.").arg(dlg.name())
		);
		return;
	}

	auto creator = new DirectoryCreator(fi.absoluteFilePath(), dlg.name(), this);

	if (dlg.hasPrototype())
		creator->setPrototype(dlg.prototype());

	creator->work();
}
コード例 #3
0
// Set prototype, and also insert the object prototype at the end of the chain.
void JSGlobalObject::resetPrototype(VM& vm, JSValue prototype)
{
    setPrototype(vm, prototype);

    JSObject* oldLastInPrototypeChain = lastInPrototypeChain(this);
    JSObject* objectPrototype = m_objectPrototype.get();
    if (oldLastInPrototypeChain != objectPrototype)
        oldLastInPrototypeChain->setPrototype(vm, objectPrototype);
}
コード例 #4
0
// Set prototype, and also insert the object prototype at the end of the chain.
void JSGlobalObject::resetPrototype(JSValue prototype)
{
    setPrototype(prototype);

    JSObject* oldLastInPrototypeChain = lastInPrototypeChain(this);
    JSObject* objectPrototype = d()->objectPrototype;
    if (oldLastInPrototypeChain != objectPrototype)
        oldLastInPrototypeChain->setPrototype(objectPrototype);
}
コード例 #5
0
JSSVGPathSegClosePath::JSSVGPathSegClosePath(ExecState* exec, SVGPathSegClosePath* impl)
    : JSSVGPathSeg(exec, impl)
{
    setPrototype(JSSVGPathSegClosePathPrototype::self(exec));
}
コード例 #6
0
ファイル: JSSVGUnitTypes.cpp プロジェクト: Crawping/davinci
 JSSVGUnitTypesConstructor(ExecState* exec)
 {
     setPrototype(exec->lexicalInterpreter()->builtinObjectPrototype());
     putDirect(exec->propertyNames().prototype, JSSVGUnitTypesPrototype::self(exec), None);
 }
コード例 #7
0
JSHTMLScriptElement::JSHTMLScriptElement(ExecState* exec, HTMLScriptElement* impl)
    : JSHTMLElement(exec, impl)
{
    setPrototype(JSHTMLScriptElementPrototype::self(exec));
}
コード例 #8
0
JSHTMLOptionElementConstructor::JSHTMLOptionElementConstructor(ExecState* exec, Document* d)
    : m_doc(d)
{
    setPrototype(exec->lexicalInterpreter()->builtinObjectPrototype());
    put(exec, lengthPropertyName, jsNumber(4), ReadOnly|DontDelete|DontEnum);
}
コード例 #9
0
JSSVGPathSegCurvetoQuadraticSmoothRel::JSSVGPathSegCurvetoQuadraticSmoothRel(ExecState* exec, SVGPathSegCurvetoQuadraticSmoothRel* impl)
    : JSSVGPathSeg(exec, impl)
{
    setPrototype(JSSVGPathSegCurvetoQuadraticSmoothRelPrototype::self(exec));
}
コード例 #10
0
JSSVGFEPointLightElement::JSSVGFEPointLightElement(ExecState* exec, SVGFEPointLightElement* impl)
    : JSSVGElement(exec, impl)
{
    setPrototype(JSSVGFEPointLightElementPrototype::self(exec));
}
コード例 #11
0
ファイル: kjs_events.cpp プロジェクト: jackiekaon/owb-mirror
JSClipboard::JSClipboard(ExecState* exec, Clipboard* clipboard)
    : m_impl(clipboard)
{
    setPrototype(JSClipboardPrototype::self(exec));
}
コード例 #12
0
JSSVGTRefElement::JSSVGTRefElement(ExecState* exec, SVGTRefElement* impl)
    : JSSVGTextPositioningElement(exec, impl)
{
    setPrototype(JSSVGTRefElementPrototype::self(exec));
}
コード例 #13
0
ファイル: JSNodeIterator.cpp プロジェクト: FilipBE/qtextended
JSNodeIterator::JSNodeIterator(ExecState* exec, NodeIterator* impl)
    : m_impl(impl)
{
    setPrototype(JSNodeIteratorPrototype::self(exec));
}
コード例 #14
0
JSSVGAnimatedRect::JSSVGAnimatedRect(ExecState* exec, SVGAnimatedRect* impl)
    : m_impl(impl)
{
    setPrototype(JSSVGAnimatedRectPrototype::self(exec));
}
コード例 #15
0
ファイル: JSNode.cpp プロジェクト: FilipBE/qtextended
JSNode::JSNode(ExecState* exec, Node* impl)
    : m_impl(impl)
{
    setPrototype(JSNodePrototype::self(exec));
}
コード例 #16
0
ファイル: JSXPathEvaluator.cpp プロジェクト: Crawping/davinci
 JSXPathEvaluatorConstructor(ExecState* exec)
 {
     setPrototype(exec->lexicalInterpreter()->builtinObjectPrototype());
     putDirect(exec->propertyNames().prototype, JSXPathEvaluatorPrototype::self(exec), None);
 }
コード例 #17
0
ファイル: JSRange.cpp プロジェクト: FilipBE/qtextended
JSRange::JSRange(ExecState* exec, Range* impl)
    : m_impl(impl)
{
    setPrototype(JSRangePrototype::self(exec));
}
コード例 #18
0
JSMouseEvent::JSMouseEvent(ExecState* exec, MouseEvent* impl)
    : JSUIEvent(exec, impl)
{
    setPrototype(JSMouseEventPrototype::self(exec));
}
コード例 #19
0
ファイル: JSSVGColor.cpp プロジェクト: FilipBE/qtextended
JSSVGColor::JSSVGColor(ExecState* exec, SVGColor* impl)
    : JSCSSValue(exec, impl)
{
    setPrototype(JSSVGColorPrototype::self(exec));
}
コード例 #20
0
JSSVGAnimateElement::JSSVGAnimateElement(ExecState* exec, SVGAnimateElement* impl)
    : JSSVGAnimationElement(exec, impl)
{
    setPrototype(JSSVGAnimateElementPrototype::self(exec));
}
コード例 #21
0
JSCSSStyleSheet::JSCSSStyleSheet(ExecState* exec, CSSStyleSheet* impl)
    : JSStyleSheet(exec, impl)
{
    setPrototype(JSCSSStyleSheetPrototype::self(exec));
}
コード例 #22
0
JSSVGElementInstanceList::JSSVGElementInstanceList(ExecState* exec, SVGElementInstanceList* impl)
    : m_impl(impl)
{
    setPrototype(JSSVGElementInstanceListPrototype::self(exec));
}
コード例 #23
0
 JSHTMLScriptElementConstructor(ExecState* exec)
 {
     setPrototype(exec->lexicalInterpreter()->builtinObjectPrototype());
     putDirect(exec->propertyNames().prototype, JSHTMLScriptElementPrototype::self(exec), None);
 }
コード例 #24
0
ファイル: JSObject.cpp プロジェクト: Mr-Kumar-Abhishek/qt
// ECMA 8.6.2.2
void JSObject::put(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot)
{
    ASSERT(value);
    ASSERT(!Heap::heap(value) || Heap::heap(value) == Heap::heap(this));

    if (propertyName == exec->propertyNames().underscoreProto) {
        // Setting __proto__ to a non-object, non-null value is silently ignored to match Mozilla.
        if (!value.isObject() && !value.isNull())
            return;

        JSValue nextPrototypeValue = value;
        while (nextPrototypeValue && nextPrototypeValue.isObject()) {
            JSObject* nextPrototype = asObject(nextPrototypeValue)->unwrappedObject();
            if (nextPrototype == this) {
                throwError(exec, GeneralError, "cyclic __proto__ value");
                return;
            }
            nextPrototypeValue = nextPrototype->prototype();
        }

        setPrototype(value);
        return;
    }

    // Check if there are any setters or getters in the prototype chain
    JSValue prototype;
    for (JSObject* obj = this; !obj->structure()->hasGetterSetterProperties(); obj = asObject(prototype)) {
        prototype = obj->prototype();
        if (prototype.isNull()) {
            putDirectInternal(exec->globalData(), propertyName, value, 0, true, slot);
            return;
        }
    }
    
    unsigned attributes;
    JSCell* specificValue;
    if ((m_structure->get(propertyName, attributes, specificValue) != WTF::notFound) && attributes & ReadOnly)
        return;

    for (JSObject* obj = this; ; obj = asObject(prototype)) {
        if (JSValue gs = obj->getDirect(propertyName)) {
            if (gs.isGetterSetter()) {
                JSObject* setterFunc = asGetterSetter(gs)->setter();        
                if (!setterFunc) {
                    throwSetterError(exec);
                    return;
                }
                
                CallData callData;
                CallType callType = setterFunc->getCallData(callData);
                MarkedArgumentBuffer args;
                args.append(value);
                call(exec, setterFunc, callType, callData, this, args);
                return;
            }

            // If there's an existing property on the object or one of its 
            // prototypes it should be replaced, so break here.
            break;
        }

        prototype = obj->prototype();
        if (prototype.isNull())
            break;
    }

    putDirectInternal(exec->globalData(), propertyName, value, 0, true, slot);
    return;
}
コード例 #25
0
JSSVGPathSegArcRel::JSSVGPathSegArcRel(ExecState* exec, SVGPathSegArcRel* impl)
    : JSSVGPathSeg(exec, impl)
{
    setPrototype(JSSVGPathSegArcRelPrototype::self(exec));
}
コード例 #26
0
ファイル: JSText.cpp プロジェクト: Crawping/davinci
JSText::JSText(ExecState* exec, Text* impl)
    : JSCharacterData(exec, impl)
{
    setPrototype(JSTextPrototype::self(exec));
}
コード例 #27
0
ファイル: JSSVGUnitTypes.cpp プロジェクト: Crawping/davinci
JSSVGUnitTypes::JSSVGUnitTypes(ExecState* exec, SVGUnitTypes* impl, SVGElement* context)
    : m_context(context)
    , m_impl(impl)
{
    setPrototype(JSSVGUnitTypesPrototype::self(exec));
}
コード例 #28
0
ファイル: JSSVGLength.cpp プロジェクト: Crawping/davinci
JSSVGLength::JSSVGLength(ExecState* exec, JSSVGPODTypeWrapper<SVGLength>* impl, SVGElement* context)
    : m_context(context)
    , m_impl(impl)
{
    setPrototype(JSSVGLengthPrototype::self(exec));
}
コード例 #29
0
JSSVGPolygonElement::JSSVGPolygonElement(ExecState* exec, SVGPolygonElement* impl)
    : JSSVGElement(exec, impl)
{
    setPrototype(JSSVGPolygonElementPrototype::self(exec));
}
コード例 #30
0
ファイル: JSXPathEvaluator.cpp プロジェクト: Crawping/davinci
JSXPathEvaluator::JSXPathEvaluator(ExecState* exec, XPathEvaluator* impl)
    : m_impl(impl)
{
    setPrototype(JSXPathEvaluatorPrototype::self(exec));
}