[Webkit-unassigned] [Bug 205669] Reflect.construct() with a the optional newTarget parameter does not work with DOM constructors

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Dec 31 18:50:28 PST 2019


https://bugs.webkit.org/show_bug.cgi?id=205669

--- Comment #4 from Sam Weinig <sam at webkit.org> ---
For reference, DOMParser's binding constructor is generated as JSDOMParser.cpp and some relevant lines are:

using JSDOMParserConstructor = JSDOMConstructor<JSDOMParser>;

template<> EncodedJSValue JSC_HOST_CALL JSDOMParserConstructor::construct(JSGlobalObject* lexicalGlobalObject, CallFrame* callFrame)
{
    VM& vm = lexicalGlobalObject->vm();
    auto throwScope = DECLARE_THROW_SCOPE(vm);
    UNUSED_PARAM(throwScope);
    auto* castedThis = jsCast<JSDOMParserConstructor*>(callFrame->jsCallee());
    ASSERT(castedThis);
    auto* context = castedThis->scriptExecutionContext();
    if (UNLIKELY(!context))
        return throwConstructorScriptExecutionContextUnavailableError(*lexicalGlobalObject, throwScope, "DOMParser");
    ASSERT(context->isDocument());
    auto& document = downcast<Document>(*context);
    auto object = DOMParser::create(document);
    return JSValue::encode(toJSNewlyCreated<IDLInterface<DOMParser>>(*lexicalGlobalObject, *castedThis->globalObject(), WTFMove(object)));
}

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20200101/999ac8e4/attachment.htm>


More information about the webkit-unassigned mailing list