diff options
Diffstat (limited to 'quickjs/quickjs.c')
-rw-r--r-- | quickjs/quickjs.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/quickjs/quickjs.c b/quickjs/quickjs.c index bae5541..561374b 100644 --- a/quickjs/quickjs.c +++ b/quickjs/quickjs.c @@ -7776,6 +7776,17 @@ int JS_PreventExtensions(JSContext *ctx, JSValueConst obj) } /* return -1 if exception otherwise TRUE or FALSE */ +int JS_HasPropertyStr(JSContext *ctx, JSValueConst obj, const char *propname) +{ + JSAtom atom; + int ret; + atom = JS_NewAtom(ctx, propname); + ret = JS_HasProperty(ctx, obj, atom); + JS_FreeAtom(ctx, atom); + return ret; +} + +/* return -1 if exception otherwise TRUE or FALSE */ int JS_HasProperty(JSContext *ctx, JSValueConst obj, JSAtom prop) { JSObject *p; |