Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 21 additions & 12 deletions quickjs.c
Original file line number Diff line number Diff line change
Expand Up @@ -7124,9 +7124,9 @@ static int JS_AutoInitProperty(JSContext *ctx, JSObject *p, JSAtom prop,
return 0;
}

JSValue JS_GetPropertyInternal2(JSContext *ctx, JSValue obj,
JSAtom prop, JSValue this_obj,
JSInlineCache* ic, BOOL throw_ref_error)
static JSValue JS_GetPropertyInternal2(JSContext *ctx, JSValue obj,
JSAtom prop, JSValue this_obj,
JSInlineCache* ic, BOOL throw_ref_error)
{
JSObject *p;
JSProperty *pr;
Expand Down Expand Up @@ -7276,13 +7276,17 @@ JSValue JS_GetPropertyInternal2(JSContext *ctx, JSValue obj,
}
}

JSValue JS_GetPropertyInternal(JSContext *ctx, JSValue obj,
JSAtom prop, JSValue this_obj,
BOOL throw_ref_error)
static JSValue JS_GetPropertyInternal(JSContext *ctx, JSValue obj,
JSAtom prop, JSValue this_obj,
BOOL throw_ref_error)
{
return JS_GetPropertyInternal2(ctx, obj, prop, this_obj, NULL, throw_ref_error);
}

JSValue JS_GetProperty(JSContext *ctx, JSValue this_obj, JSAtom prop)
{
return JS_GetPropertyInternal2(ctx, this_obj, prop, this_obj, NULL, FALSE);
}

static JSValue JS_GetPropertyInternalWithIC(JSContext *ctx, JSValue obj,
JSAtom prop, JSValue this_obj,
Expand Down Expand Up @@ -8040,7 +8044,7 @@ static int JS_TryGetPropertyInt64(JSContext *ctx, JSValue obj, int64_t idx, JSVa
return present;
}

static JSValue JS_GetPropertyInt64(JSContext *ctx, JSValue obj, int64_t idx)
JSValue JS_GetPropertyInt64(JSContext *ctx, JSValue obj, int64_t idx)
{
JSAtom prop;
JSValue val;
Expand Down Expand Up @@ -8412,9 +8416,9 @@ static void js_free_desc(JSContext *ctx, JSPropertyDescriptor *desc)
the new property is not added and an error is raised.
'obj' must be an object when obj != this_obj.
*/
int JS_SetPropertyInternal2(JSContext *ctx, JSValue obj,
JSAtom prop, JSValue val, JSValue this_obj,
int flags, JSInlineCache *ic)
static int JS_SetPropertyInternal2(JSContext *ctx, JSValue obj,
JSAtom prop, JSValue val, JSValue this_obj,
int flags, JSInlineCache *ic)
{
JSObject *p, *p1;
JSShapeProperty *prs;
Expand Down Expand Up @@ -8665,13 +8669,18 @@ int JS_SetPropertyInternal2(JSContext *ctx, JSValue obj,
return -1;
}

int JS_SetPropertyInternal(JSContext *ctx, JSValue this_obj,
JSAtom prop, JSValue val, int flags)
static int JS_SetPropertyInternal(JSContext *ctx, JSValue this_obj,
JSAtom prop, JSValue val, int flags)
{
return JS_SetPropertyInternal2(ctx, this_obj, prop, val, this_obj,
flags, NULL);
}

int JS_SetProperty(JSContext *ctx, JSValue this_obj, JSAtom prop, JSValue val)
{
return JS_SetPropertyInternal2(ctx, this_obj, prop, val, this_obj, JS_PROP_THROW, NULL);
}

static int JS_SetPropertyInternalWithIC(JSContext *ctx, JSValue this_obj,
JSAtom prop, JSValue val, int flags,
JSInlineCache *ic, int32_t offset) {
Expand Down
25 changes: 7 additions & 18 deletions quickjs.h
Original file line number Diff line number Diff line change
Expand Up @@ -656,27 +656,16 @@ JS_EXTERN int JS_IsArray(JSContext *ctx, JSValue val);

JS_EXTERN JSValue JS_NewDate(JSContext *ctx, double epoch_ms);

JS_EXTERN JSValue JS_GetPropertyInternal(JSContext *ctx, JSValue obj,
JSAtom prop, JSValue receiver,
JS_BOOL throw_ref_error);
static js_force_inline JSValue JS_GetProperty(JSContext *ctx, JSValue this_obj,
JSAtom prop)
{
return JS_GetPropertyInternal(ctx, this_obj, prop, this_obj, 0);
}
JS_EXTERN JSValue JS_GetPropertyStr(JSContext *ctx, JSValue this_obj,
const char *prop);
JS_EXTERN JSValue JS_GetProperty(JSContext *ctx, JSValue this_obj, JSAtom prop);
JS_EXTERN JSValue JS_GetPropertyUint32(JSContext *ctx, JSValue this_obj,
uint32_t idx);
JS_EXTERN JSValue JS_GetPropertyInt64(JSContext *ctx, JSValue this_obj,
int64_t idx);
JS_EXTERN JSValue JS_GetPropertyStr(JSContext *ctx, JSValue this_obj,
const char *prop);

int JS_SetPropertyInternal(JSContext *ctx, JSValue this_obj,
JSAtom prop, JSValue val,
int flags);
static inline int JS_SetProperty(JSContext *ctx, JSValue this_obj,
JSAtom prop, JSValue val)
{
return JS_SetPropertyInternal(ctx, this_obj, prop, val, JS_PROP_THROW);
}
JS_EXTERN int JS_SetProperty(JSContext *ctx, JSValue this_obj,
JSAtom prop, JSValue val);
JS_EXTERN int JS_SetPropertyUint32(JSContext *ctx, JSValue this_obj,
uint32_t idx, JSValue val);
JS_EXTERN int JS_SetPropertyInt64(JSContext *ctx, JSValue this_obj,
Expand Down