mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 664951 - Weaken CallJSNativeConstructor again (r=waldo)
This commit is contained in:
parent
3ca1688adf
commit
2ebc3262be
4
js/src/jit-test/tests/basic/testBug660734.js
Normal file
4
js/src/jit-test/tests/basic/testBug660734.js
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
var handler = { fix: function() { return []; } };
|
||||||
|
var p = Proxy.createFunction(handler, function(){}, function(){});
|
||||||
|
Proxy.fix(p);
|
||||||
|
new p();
|
@ -317,7 +317,10 @@ CallJSNativeConstructor(JSContext *cx, js::Native native, const CallArgs &args)
|
|||||||
* (new Object(Object)) returns the callee.
|
* (new Object(Object)) returns the callee.
|
||||||
*/
|
*/
|
||||||
extern JSBool proxy_Construct(JSContext *, uintN, Value *);
|
extern JSBool proxy_Construct(JSContext *, uintN, Value *);
|
||||||
JS_ASSERT_IF(native != proxy_Construct && native != js::CallOrConstructBoundFunction &&
|
extern JSBool callable_Construct(JSContext *, uintN, Value *);
|
||||||
|
JS_ASSERT_IF(native != proxy_Construct &&
|
||||||
|
native != callable_Construct &&
|
||||||
|
native != js::CallOrConstructBoundFunction &&
|
||||||
(!callee.isFunction() || callee.getFunctionPrivate()->u.n.clasp != &js_ObjectClass),
|
(!callee.isFunction() || callee.getFunctionPrivate()->u.n.clasp != &js_ObjectClass),
|
||||||
!args.rval().isPrimitive() && callee != args.rval().toObject());
|
!args.rval().isPrimitive() && callee != args.rval().toObject());
|
||||||
|
|
||||||
|
@ -1332,7 +1332,7 @@ callable_Call(JSContext *cx, uintN argc, Value *vp)
|
|||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
static JSBool
|
JSBool
|
||||||
callable_Construct(JSContext *cx, uintN argc, Value *vp)
|
callable_Construct(JSContext *cx, uintN argc, Value *vp)
|
||||||
{
|
{
|
||||||
JSObject *thisobj = js_CreateThis(cx, &JS_CALLEE(cx, vp).toObject());
|
JSObject *thisobj = js_CreateThis(cx, &JS_CALLEE(cx, vp).toObject());
|
||||||
|
Loading…
Reference in New Issue
Block a user