mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-25 00:27:29 +09:00
Merge remote-tracking branch 'origin/tracking' into custom
This commit is contained in:
commit
ca9d8d3960
8 changed files with 31 additions and 65 deletions
|
|
@ -6226,8 +6226,6 @@ WorkerPrivate::RunExpiredTimeouts(JSContext* aCx)
|
||||||
// Guard against recursion.
|
// Guard against recursion.
|
||||||
mRunningExpiredTimeouts = true;
|
mRunningExpiredTimeouts = true;
|
||||||
|
|
||||||
MOZ_DIAGNOSTIC_ASSERT(data->mCurrentTimerNestingLevel == 0);
|
|
||||||
|
|
||||||
// Run expired timeouts.
|
// Run expired timeouts.
|
||||||
for (uint32_t index = 0; index < expiredTimeouts.Length(); index++) {
|
for (uint32_t index = 0; index < expiredTimeouts.Length(); index++) {
|
||||||
TimeoutInfo*& info = expiredTimeouts[index];
|
TimeoutInfo*& info = expiredTimeouts[index];
|
||||||
|
|
|
||||||
|
|
@ -2790,7 +2790,7 @@ ReadableStreamControllerCallPullIfNeeded(JSContext* cx, HandleNativeObject contr
|
||||||
} else {
|
} else {
|
||||||
pullPromise = PromiseInvokeOrNoop(cx, underlyingSource, cx->names().pull, controllerVal);
|
pullPromise = PromiseInvokeOrNoop(cx, underlyingSource, cx->names().pull, controllerVal);
|
||||||
}
|
}
|
||||||
if (!pullPromise)
|
if (!pullPromise || !pullPromise->is<PromiseObject>())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
RootedObject onPullFulfilled(cx, NewHandler(cx, ControllerPullHandler, controller));
|
RootedObject onPullFulfilled(cx, NewHandler(cx, ControllerPullHandler, controller));
|
||||||
|
|
|
||||||
|
|
@ -5593,9 +5593,6 @@ TryAttachCallStub(JSContext* cx, ICCall_Fallback* stub, HandleScript script, jsb
|
||||||
RootedObject obj(cx, &callee.toObject());
|
RootedObject obj(cx, &callee.toObject());
|
||||||
if (!obj->is<JSFunction>()) {
|
if (!obj->is<JSFunction>()) {
|
||||||
// Try to attach a stub for a call/construct hook on the object.
|
// Try to attach a stub for a call/construct hook on the object.
|
||||||
// Ignore proxies, which are special cased by callHook/constructHook.
|
|
||||||
if (obj->is<ProxyObject>())
|
|
||||||
return true;
|
|
||||||
if (JSNative hook = constructing ? obj->constructHook() : obj->callHook()) {
|
if (JSNative hook = constructing ? obj->constructHook() : obj->callHook()) {
|
||||||
if (op != JSOP_FUNAPPLY && !isSpread && !createSingleton) {
|
if (op != JSOP_FUNAPPLY && !isSpread && !createSingleton) {
|
||||||
RootedObject templateObject(cx);
|
RootedObject templateObject(cx);
|
||||||
|
|
|
||||||
|
|
@ -278,22 +278,9 @@ CallJSNativeConstructor(JSContext* cx, Native native, const CallArgs& args)
|
||||||
* constructor to return the callee, the assertion can be removed or
|
* constructor to return the callee, the assertion can be removed or
|
||||||
* (another) conjunct can be added to the antecedent.
|
* (another) conjunct can be added to the antecedent.
|
||||||
*
|
*
|
||||||
* Exceptions:
|
* Exception: (new Object(Object)) returns the callee.
|
||||||
*
|
|
||||||
* - Proxies are exceptions to both rules: they can return primitives and
|
|
||||||
* they allow content to return the callee.
|
|
||||||
*
|
|
||||||
* - CallOrConstructBoundFunction is an exception as well because we might
|
|
||||||
* have used bind on a proxy function.
|
|
||||||
*
|
|
||||||
* - new Iterator(x) is user-hookable; it returns x.__iterator__() which
|
|
||||||
* could be any object.
|
|
||||||
*
|
|
||||||
* - (new Object(Object)) returns the callee.
|
|
||||||
*/
|
*/
|
||||||
MOZ_ASSERT_IF(native != js::proxy_Construct &&
|
MOZ_ASSERT_IF((!callee->is<JSFunction>() || callee->as<JSFunction>().native() != obj_construct),
|
||||||
native != js::IteratorConstructor &&
|
|
||||||
(!callee->is<JSFunction>() || callee->as<JSFunction>().native() != obj_construct),
|
|
||||||
args.rval().isObject() && callee != &args.rval().toObject());
|
args.rval().isObject() && callee != &args.rval().toObject());
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
|
|
@ -2066,6 +2066,10 @@ JSObject::isCallable() const
|
||||||
{
|
{
|
||||||
if (is<JSFunction>())
|
if (is<JSFunction>())
|
||||||
return true;
|
return true;
|
||||||
|
if (is<js::ProxyObject>()) {
|
||||||
|
const js::ProxyObject& p = as<js::ProxyObject>();
|
||||||
|
return p.handler()->isCallable(const_cast<JSObject*>(this));
|
||||||
|
}
|
||||||
return callHook() != nullptr;
|
return callHook() != nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2076,39 +2080,23 @@ JSObject::isConstructor() const
|
||||||
const JSFunction& fun = as<JSFunction>();
|
const JSFunction& fun = as<JSFunction>();
|
||||||
return fun.isConstructor();
|
return fun.isConstructor();
|
||||||
}
|
}
|
||||||
|
if (is<js::ProxyObject>()) {
|
||||||
|
const js::ProxyObject& p = as<js::ProxyObject>();
|
||||||
|
return p.handler()->isConstructor(const_cast<JSObject*>(this));
|
||||||
|
}
|
||||||
return constructHook() != nullptr;
|
return constructHook() != nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
JSNative
|
JSNative
|
||||||
JSObject::callHook() const
|
JSObject::callHook() const
|
||||||
{
|
{
|
||||||
const js::Class* clasp = getClass();
|
return getClass()->getCall();
|
||||||
|
|
||||||
if (JSNative call = clasp->getCall())
|
|
||||||
return call;
|
|
||||||
|
|
||||||
if (is<js::ProxyObject>()) {
|
|
||||||
const js::ProxyObject& p = as<js::ProxyObject>();
|
|
||||||
if (p.handler()->isCallable(const_cast<JSObject*>(this)))
|
|
||||||
return js::proxy_Call;
|
|
||||||
}
|
|
||||||
return nullptr;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
JSNative
|
JSNative
|
||||||
JSObject::constructHook() const
|
JSObject::constructHook() const
|
||||||
{
|
{
|
||||||
const js::Class* clasp = getClass();
|
return getClass()->getConstruct();
|
||||||
|
|
||||||
if (JSNative construct = clasp->getConstruct())
|
|
||||||
return construct;
|
|
||||||
|
|
||||||
if (is<js::ProxyObject>()) {
|
|
||||||
const js::ProxyObject& p = as<js::ProxyObject>();
|
|
||||||
if (p.handler()->isConstructor(const_cast<JSObject*>(this)))
|
|
||||||
return js::proxy_Construct;
|
|
||||||
}
|
|
||||||
return nullptr;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
|
|
||||||
|
|
@ -665,24 +665,6 @@ js::proxy_HasInstance(JSContext* cx, HandleObject proxy, MutableHandleValue v, b
|
||||||
return Proxy::hasInstance(cx, proxy, v, bp);
|
return Proxy::hasInstance(cx, proxy, v, bp);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
|
||||||
js::proxy_Call(JSContext* cx, unsigned argc, Value* vp)
|
|
||||||
{
|
|
||||||
CallArgs args = CallArgsFromVp(argc, vp);
|
|
||||||
RootedObject proxy(cx, &args.callee());
|
|
||||||
MOZ_ASSERT(proxy->is<ProxyObject>());
|
|
||||||
return Proxy::call(cx, proxy, args);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
|
||||||
js::proxy_Construct(JSContext* cx, unsigned argc, Value* vp)
|
|
||||||
{
|
|
||||||
CallArgs args = CallArgsFromVp(argc, vp);
|
|
||||||
RootedObject proxy(cx, &args.callee());
|
|
||||||
MOZ_ASSERT(proxy->is<ProxyObject>());
|
|
||||||
return Proxy::construct(cx, proxy, args);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
bool
|
||||||
js::proxy_GetElements(JSContext* cx, HandleObject proxy, uint32_t begin, uint32_t end,
|
js::proxy_GetElements(JSContext* cx, HandleObject proxy, uint32_t begin, uint32_t end,
|
||||||
ElementAdder* adder)
|
ElementAdder* adder)
|
||||||
|
|
|
||||||
|
|
@ -457,10 +457,18 @@ js::InternalCallOrConstruct(JSContext* cx, const CallArgs& args, MaybeConstruct
|
||||||
|
|
||||||
/* Invoke non-functions. */
|
/* Invoke non-functions. */
|
||||||
if (MOZ_UNLIKELY(!args.callee().is<JSFunction>())) {
|
if (MOZ_UNLIKELY(!args.callee().is<JSFunction>())) {
|
||||||
MOZ_ASSERT_IF(construct, !args.callee().constructHook());
|
MOZ_ASSERT_IF(construct, !args.callee().isConstructor());
|
||||||
JSNative call = args.callee().callHook();
|
|
||||||
if (!call)
|
if (!args.callee().isCallable())
|
||||||
return ReportIsNotFunction(cx, args.calleev(), skipForCallee, construct);
|
return ReportIsNotFunction(cx, args.calleev(), skipForCallee, construct);
|
||||||
|
|
||||||
|
if (args.callee().is<ProxyObject>()) {
|
||||||
|
RootedObject proxy(cx, &args.callee());
|
||||||
|
return Proxy::call(cx, proxy, args);
|
||||||
|
}
|
||||||
|
|
||||||
|
JSNative call = args.callee().callHook();
|
||||||
|
MOZ_ASSERT(call, "isCallable without a callHook?");
|
||||||
return CallJSNative(cx, call, args);
|
return CallJSNative(cx, call, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -579,6 +587,11 @@ InternalConstruct(JSContext* cx, const AnyConstructArgs& args)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (callee.is<ProxyObject>()) {
|
||||||
|
RootedObject proxy(cx, &callee);
|
||||||
|
return Proxy::construct(cx, proxy, args);
|
||||||
|
}
|
||||||
|
|
||||||
JSNative construct = callee.constructHook();
|
JSNative construct = callee.constructHook();
|
||||||
MOZ_ASSERT(construct != nullptr, "IsConstructor without a construct hook?");
|
MOZ_ASSERT(construct != nullptr, "IsConstructor without a construct hook?");
|
||||||
|
|
||||||
|
|
@ -4846,7 +4859,7 @@ js::SpreadCallOperation(JSContext* cx, HandleScript script, jsbytecode* pc, Hand
|
||||||
constructing ? CONSTRUCT : NO_CONSTRUCT);
|
constructing ? CONSTRUCT : NO_CONSTRUCT);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (MOZ_UNLIKELY(!callee.toObject().is<JSFunction>()) && !callee.toObject().callHook()) {
|
if (!callee.toObject().isCallable()) {
|
||||||
return ReportIsNotFunction(cx, callee, 2 + constructing,
|
return ReportIsNotFunction(cx, callee, 2 + constructing,
|
||||||
constructing ? CONSTRUCT : NO_CONSTRUCT);
|
constructing ? CONSTRUCT : NO_CONSTRUCT);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -234,6 +234,7 @@ nsHttpHeaderArray::IsSingletonHeader(nsHttpAtom header)
|
||||||
header == nsHttp::From ||
|
header == nsHttp::From ||
|
||||||
header == nsHttp::Location ||
|
header == nsHttp::Location ||
|
||||||
header == nsHttp::Max_Forwards ||
|
header == nsHttp::Max_Forwards ||
|
||||||
|
header == nsHttp::GlobalPrivacyControl ||
|
||||||
// Ignore-multiple-headers are singletons in the sense that they
|
// Ignore-multiple-headers are singletons in the sense that they
|
||||||
// shouldn't be merged.
|
// shouldn't be merged.
|
||||||
IsIgnoreMultipleHeader(header);
|
IsIgnoreMultipleHeader(header);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue