@@ -48695,23 +48695,19 @@ static const JSClassExoticMethods js_proxy_exotic_methods = {
4869548695 .set_property = js_proxy_set,
4869648696};
4869748697
48698- static JSValue js_proxy_constructor(JSContext *ctx, JSValueConst this_val,
48699- int argc, JSValueConst *argv)
48698+ JSValue JS_NewProxy(JSContext *ctx, JSValueConst target, JSValueConst handler)
4870048699{
48701- JSValueConst target, handler;
48702- JSValue obj;
4870348700 JSProxyData *s;
48701+ JSValue obj;
4870448702
48705- target = argv[0];
48706- handler = argv[1];
4870748703 if (JS_VALUE_GET_TAG(target) != JS_TAG_OBJECT ||
48708- JS_VALUE_GET_TAG(handler) != JS_TAG_OBJECT)
48704+ JS_VALUE_GET_TAG(handler) != JS_TAG_OBJECT) {
4870948705 return JS_ThrowTypeErrorNotAnObject(ctx);
48710-
48706+ }
4871148707 obj = JS_NewObjectProtoClass(ctx, JS_NULL, JS_CLASS_PROXY);
4871248708 if (JS_IsException(obj))
4871348709 return obj;
48714- s = js_malloc(ctx, sizeof(JSProxyData ));
48710+ s = js_malloc(ctx, sizeof(*s ));
4871548711 if (!s) {
4871648712 JS_FreeValue(ctx, obj);
4871748713 return JS_EXCEPTION;
@@ -48725,6 +48721,12 @@ static JSValue js_proxy_constructor(JSContext *ctx, JSValueConst this_val,
4872548721 return obj;
4872648722}
4872748723
48724+ static JSValue js_proxy_constructor(JSContext *ctx, JSValueConst this_val,
48725+ int argc, JSValueConst *argv)
48726+ {
48727+ return JS_NewProxy(ctx, argv[0], argv[1]);
48728+ }
48729+
4872848730static JSValue js_proxy_revoke(JSContext *ctx, JSValueConst this_val,
4872948731 int argc, JSValueConst *argv, int magic,
4873048732 JSValueConst *func_data)
0 commit comments