summaryrefslogtreecommitdiff
path: root/quickjs.c
diff options
context:
space:
mode:
Diffstat (limited to 'quickjs.c')
-rw-r--r--quickjs.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/quickjs.c b/quickjs.c
index 89e8501..0268061 100644
--- a/quickjs.c
+++ b/quickjs.c
@@ -37312,6 +37312,7 @@ static __exception int JS_ObjectDefineProperties(JSContext *ctx,
if (JS_IsException(props))
return -1;
p = JS_VALUE_GET_OBJ(props);
+ /* XXX: not done in the same order as the spec */
if (JS_GetOwnPropertyNamesInternal(ctx, &atoms, &len, p, JS_GPN_ENUM_ONLY | JS_GPN_STRING_MASK | JS_GPN_SYMBOL_MASK) < 0)
goto exception;
for(i = 0; i < len; i++) {
@@ -38268,17 +38269,17 @@ exception:
static JSValue js_object_propertyIsEnumerable(JSContext *ctx, JSValueConst this_val,
int argc, JSValueConst *argv)
{
- JSValue obj, res = JS_EXCEPTION;
- JSAtom prop = JS_ATOM_NULL;
+ JSValue obj = JS_UNDEFINED, res = JS_EXCEPTION;
+ JSAtom prop;
JSPropertyDescriptor desc;
int has_prop;
- obj = JS_ToObject(ctx, this_val);
- if (JS_IsException(obj))
- goto exception;
prop = JS_ValueToAtom(ctx, argv[0]);
if (unlikely(prop == JS_ATOM_NULL))
goto exception;
+ obj = JS_ToObject(ctx, this_val);
+ if (JS_IsException(obj))
+ goto exception;
has_prop = JS_GetOwnPropertyInternal(ctx, &desc, JS_VALUE_GET_OBJ(obj), prop);
if (has_prop < 0)