summaryrefslogtreecommitdiff
path: root/quickjs.c
diff options
context:
space:
mode:
Diffstat (limited to 'quickjs.c')
-rw-r--r--quickjs.c752
1 files changed, 376 insertions, 376 deletions
diff --git a/quickjs.c b/quickjs.c
index 7958f81..f7c33ed 100644
--- a/quickjs.c
+++ b/quickjs.c
@@ -1,6 +1,6 @@
/*
* QuickJS Javascript Engine
- *
+ *
* Copyright (c) 2017-2021 Fabrice Bellard
* Copyright (c) 2017-2021 Charlie Gordon
*
@@ -193,7 +193,7 @@ typedef enum JSErrorEnum {
JS_URI_ERROR,
JS_INTERNAL_ERROR,
JS_AGGREGATE_ERROR,
-
+
JS_NATIVE_ERROR_COUNT, /* number of different NativeError objects */
} JSErrorEnum;
@@ -254,7 +254,7 @@ struct JSRuntime {
by the garbage collector) */
struct list_head gc_obj_list;
/* list of JSGCObjectHeader.link. Used during JS_FreeValueRT() */
- struct list_head gc_zero_ref_count_list;
+ struct list_head gc_zero_ref_count_list;
struct list_head tmp_obj_list; /* used during GC */
JSGCPhaseEnum gc_phase : 8;
size_t malloc_gc_threshold;
@@ -265,7 +265,7 @@ struct JSRuntime {
uintptr_t stack_size; /* in bytes, 0 if no limit */
uintptr_t stack_top;
uintptr_t stack_limit; /* lower stack limit */
-
+
JSValue current_exception;
/* true if inside an out of memory error, to avoid recursing */
BOOL in_out_of_memory : 8;
@@ -277,7 +277,7 @@ struct JSRuntime {
JSHostPromiseRejectionTracker *host_promise_rejection_tracker;
void *host_promise_rejection_tracker_opaque;
-
+
struct list_head job_list; /* list of JSJobEntry.link */
JSModuleNormalizeFunc *module_normalize_func;
@@ -285,11 +285,11 @@ struct JSRuntime {
void *module_loader_opaque;
/* timestamp for internal use in module evaluation */
int64_t module_async_evaluation_next_timestamp;
-
+
BOOL can_block : 8; /* TRUE if Atomics.wait can block */
/* used to allocate, free and clone SharedArrayBuffers */
JSSharedArrayBufferFunctions sab_funcs;
-
+
/* Shape hash table */
int shape_hash_bits;
int shape_hash_size;
@@ -331,7 +331,7 @@ typedef struct JSStackFrame {
int arg_count;
int js_mode; /* for C functions, only JS_MODE_MATH may be set */
/* only used in generators. Current stack pointer value. NULL if
- the function is running. */
+ the function is running. */
JSValue *cur_sp;
} JSStackFrame;
@@ -362,7 +362,7 @@ typedef struct JSVarRef {
struct {
int __gc_ref_count; /* corresponds to header.ref_count */
uint8_t __gc_mark; /* corresponds to header.mark/gc_obj_type */
- uint8_t is_detached : 1;
+ uint8_t is_detached : 1;
uint8_t is_arg : 1;
uint16_t var_idx; /* index of the corresponding function variable on
the stack */
@@ -544,7 +544,7 @@ typedef struct JSVarDef {
JSAtom var_name;
/* index into fd->scopes of this variable lexical scope */
int scope_level;
- /* during compilation:
+ /* during compilation:
- if scope_level = 0: scope in which the variable is defined
- if scope_level != 0: index into fd->vars of the next
variable in the same or enclosing lexical scope
@@ -552,7 +552,7 @@ typedef struct JSVarDef {
index into fd->vars of the next
variable in the same or enclosing lexical scope
*/
- int scope_next;
+ int scope_next;
uint8_t is_const : 1;
uint8_t is_lexical : 1;
uint8_t is_captured : 1;
@@ -597,7 +597,7 @@ typedef struct JSFunctionBytecode {
uint8_t has_debug : 1;
uint8_t backtrace_barrier : 1; /* stop backtrace on this function */
uint8_t read_only_bytecode : 1;
- uint8_t is_direct_or_indirect_eval : 1; /* used by JS_GetScriptOrModuleName() */
+ uint8_t is_direct_or_indirect_eval : 1; /* used by JS_GetScriptOrModuleName() */
/* XXX: 4 bits available */
uint8_t *byte_code_buf; /* (self pointer) */
int byte_code_len;
@@ -817,10 +817,10 @@ struct JSModuleDef {
JSModuleDef *cycle_root;
JSValue promise; /* corresponds to spec field: capability */
JSValue resolving_funcs[2]; /* corresponds to spec field: capability */
-
+
/* true if evaluation yielded an exception. It is saved in
eval_exception */
- BOOL eval_has_exception : 8;
+ BOOL eval_has_exception : 8;
JSValue eval_exception;
JSValue meta_obj; /* for import.meta */
};
@@ -888,7 +888,7 @@ struct JSObject {
struct {
int __gc_ref_count; /* corresponds to header.ref_count */
uint8_t __gc_mark; /* corresponds to header.mark/gc_obj_type */
-
+
uint8_t extensible : 1;
uint8_t free_mark : 1; /* only used when freeing objects with cycles */
uint8_t is_exotic : 1; /* TRUE if object has exotic property handlers */
@@ -948,7 +948,7 @@ struct JSObject {
struct JSTypedArray *typed_array; /* JS_CLASS_UINT8C_ARRAY..JS_CLASS_FLOAT64_ARRAY */
} u1;
union {
- JSValue *values; /* JS_CLASS_ARRAY, JS_CLASS_ARGUMENTS */
+ JSValue *values; /* JS_CLASS_ARRAY, JS_CLASS_ARGUMENTS */
void *ptr; /* JS_CLASS_UINT8C_ARRAY..JS_CLASS_FLOAT64_ARRAY */
int8_t *int8_ptr; /* JS_CLASS_INT8_ARRAY */
uint8_t *uint8_ptr; /* JS_CLASS_UINT8_ARRAY, JS_CLASS_UINT8C_ARRAY */
@@ -1647,7 +1647,7 @@ JSRuntime *JS_NewRuntime2(const JSMallocFunctions *mf, void *opaque)
init_list_head(&rt->gc_obj_list);
init_list_head(&rt->gc_zero_ref_count_list);
rt->gc_phase = JS_GC_PHASE_NONE;
-
+
#ifdef DUMP_LEAKS
init_list_head(&rt->string_list);
#endif
@@ -2280,7 +2280,7 @@ void JS_FreeContext(JSContext *ctx)
if (--ctx->header.ref_count > 0)
return;
assert(ctx->header.ref_count == 0);
-
+
#ifdef DUMP_ATOMS
JS_DumpAtoms(ctx->rt);
#endif
@@ -3337,7 +3337,7 @@ static JSAtom js_atom_concat_str(JSContext *ctx, JSAtom name, const char *str1)
const char *cstr;
char *cstr2;
size_t len, len1;
-
+
str = JS_AtomToString(ctx, name);
if (JS_IsException(str))
return JS_ATOM_NULL;
@@ -3884,7 +3884,7 @@ JSValue JS_NewStringLen(JSContext *ctx, const char *buf, size_t buf_len)
uint32_t c;
StringBuffer b_s, *b = &b_s;
size_t len1;
-
+
p_start = (const uint8_t *)buf;
p_end = p_start + buf_len;
p = p_start;
@@ -4376,7 +4376,7 @@ static no_inline JSShape *js_new_shape2(JSContext *ctx, JSObject *proto,
sh->prop_size = prop_size;
sh->prop_count = 0;
sh->deleted_prop_count = 0;
-
+
/* insert in the hash table */
sh->hash = shape_initial_hash(proto);
sh->is_hashed = TRUE;
@@ -4497,7 +4497,7 @@ static no_inline int resize_properties(JSContext *ctx, JSShape **psh,
memcpy(sh, old_sh,
sizeof(JSShape) + sizeof(sh->prop[0]) * old_sh->prop_count);
list_add_tail(&sh->header.link, &ctx->rt->gc_obj_list);
-
+
if (new_hash_size != (sh->prop_hash_mask + 1)) {
/* resize the hash table and the properties */
new_hash_mask = new_hash_size - 1;
@@ -4531,7 +4531,7 @@ static int compact_properties(JSContext *ctx, JSObject *p)
uint32_t new_hash_size, i, j, new_hash_mask, new_size;
JSShapeProperty *old_pr, *pr;
JSProperty *prop, *new_prop;
-
+
sh = p->shape;
assert(!sh->is_hashed);
@@ -4553,7 +4553,7 @@ static int compact_properties(JSContext *ctx, JSObject *p)
list_del(&old_sh->header.link);
memcpy(sh, old_sh, sizeof(JSShape));
list_add_tail(&sh->header.link, &ctx->rt->gc_obj_list);
-
+
memset(prop_hash_end(sh) - new_hash_size, 0,
sizeof(prop_hash_end(sh)[0]) * new_hash_size);
@@ -4582,7 +4582,7 @@ static int compact_properties(JSContext *ctx, JSObject *p)
p->shape = sh;
js_free(ctx, get_alloc_from_shape(old_sh));
-
+
/* reduce the size of the object properties */
new_prop = js_realloc(ctx, p->prop, sizeof(new_prop[0]) * new_size);
if (new_prop)
@@ -4709,7 +4709,7 @@ static __maybe_unused void JS_DumpShapes(JSRuntime *rt)
struct list_head *el;
JSObject *p;
JSGCObjectHeader *gp;
-
+
printf("JSShapes: {\n");
printf("%5s %4s %14s %5s %5s %s\n", "SLOT", "REFS", "PROTO", "SIZE", "COUNT", "PROPS");
for(i = 0; i < rt->shape_hash_size; i++) {
@@ -5035,7 +5035,7 @@ static JSValue JS_NewCFunction3(JSContext *ctx, JSCFunction *func,
JSValue func_obj;
JSObject *p;
JSAtom name_atom;
-
+
func_obj = JS_NewObjectProtoClass(ctx, proto_val, JS_CLASS_C_FUNCTION);
if (JS_IsException(func_obj))
return func_obj;
@@ -5392,7 +5392,7 @@ static void js_for_in_iterator_finalizer(JSRuntime *rt, JSValue val)
JSObject *p = JS_VALUE_GET_OBJ(val);
JSForInIterator *it = p->u.for_in_iterator;
int i;
-
+
JS_FreeValueRT(rt, it->obj);
if (!it->is_array) {
for(i = 0; i < it->atom_count; i++) {
@@ -5479,7 +5479,7 @@ static void free_zero_refcount(JSRuntime *rt)
{
struct list_head *el;
JSGCObjectHeader *p;
-
+
rt->gc_phase = JS_GC_PHASE_DECREF;
for(;;) {
el = rt->gc_zero_ref_count_list.next;
@@ -5542,7 +5542,7 @@ void __JS_FreeValueRT(JSRuntime *rt, JSValue v)
case JS_TAG_BIG_INT:
#ifdef CONFIG_BIGNUM
case JS_TAG_BIG_FLOAT:
-#endif
+#endif
{
JSBigFloat *bf = JS_VALUE_GET_PTR(v);
bf_delete(&bf->num);
@@ -5727,7 +5727,7 @@ static void gc_decref(JSRuntime *rt)
{
struct list_head *el, *el1;
JSGCObjectHeader *p;
-
+
init_list_head(&rt->tmp_obj_list);
/* decrement the refcount of all the children of all the GC
@@ -5774,7 +5774,7 @@ static void gc_scan(JSRuntime *rt)
p->mark = 0; /* reset the mark for the next GC call */
mark_children(rt, p, gc_scan_incref_child);
}
-
+
/* restore the refcount of the objects to be deleted. */
list_for_each(el, &rt->tmp_obj_list) {
p = list_entry(el, JSGCObjectHeader, link);
@@ -5821,7 +5821,7 @@ static void gc_free_cycles(JSRuntime *rt)
}
}
rt->gc_phase = JS_GC_PHASE_NONE;
-
+
list_for_each_safe(el, el1, &rt->gc_zero_ref_count_list) {
p = list_entry(el, JSGCObjectHeader, link);
assert(p->gc_obj_type == JS_GC_OBJ_TYPE_JS_OBJECT ||
@@ -6487,7 +6487,7 @@ static const char *get_func_name(JSContext *ctx, JSValueConst func)
JSProperty *pr;
JSShapeProperty *prs;
JSValueConst val;
-
+
if (JS_VALUE_GET_TAG(func) != JS_TAG_OBJECT)
return NULL;
prs = find_own_property(&pr, JS_VALUE_GET_OBJ(func), JS_ATOM_name);
@@ -6518,7 +6518,7 @@ static void build_backtrace(JSContext *ctx, JSValueConst error_obj,
const char *str1;
JSObject *p;
BOOL backtrace_barrier;
-
+
js_dbuf_init(ctx, &dbuf);
if (filename) {
dbuf_printf(&dbuf, " at %s", filename);
@@ -7360,7 +7360,7 @@ static int JS_AddBrand(JSContext *ctx, JSValueConst obj, JSValueConst home_obj)
JSProperty *pr;
JSValue brand;
JSAtom brand_atom;
-
+
if (unlikely(JS_VALUE_GET_TAG(home_obj) != JS_TAG_OBJECT)) {
JS_ThrowTypeErrorNotAnObject(ctx);
return -1;
@@ -7382,7 +7382,7 @@ static int JS_AddBrand(JSContext *ctx, JSValueConst obj, JSValueConst home_obj)
brand = JS_DupValue(ctx, pr->u.value);
}
brand_atom = js_symbol_to_atom(ctx, brand);
-
+
if (JS_IsObject(obj)) {
p1 = JS_VALUE_GET_OBJ(obj);
prs = find_own_property(&pr, p1, brand_atom);
@@ -7410,7 +7410,7 @@ static int JS_CheckBrand(JSContext *ctx, JSValueConst obj, JSValueConst func)
JSShapeProperty *prs;
JSProperty *pr;
JSValueConst brand;
-
+
/* get the home object of 'func' */
if (unlikely(JS_VALUE_GET_TAG(func) != JS_TAG_OBJECT))
goto not_obj;
@@ -7429,7 +7429,7 @@ static int JS_CheckBrand(JSContext *ctx, JSValueConst obj, JSValueConst func)
/* safety check */
if (unlikely(JS_VALUE_GET_TAG(brand) != JS_TAG_SYMBOL))
goto not_obj;
-
+
/* get the brand array of 'obj' */
if (unlikely(JS_VALUE_GET_TAG(obj) != JS_TAG_OBJECT)) {
not_obj:
@@ -7503,7 +7503,7 @@ static int __exception JS_GetOwnPropertyNamesInternal(JSContext *ctx,
BOOL is_enumerable, num_sorted;
uint32_t num_key;
JSAtomKindEnum kind;
-
+
/* clear pointer for consistency in case of failure */
*ptab = NULL;
*plen = 0;
@@ -8358,7 +8358,7 @@ static JSValue js_allocate_fast_array(JSContext *ctx, int64_t len)
{
JSValue arr;
JSObject *p;
-
+
if (len > INT32_MAX)
return JS_ThrowRangeError(ctx, "invalid array length");
arr = JS_NewArray(ctx);
@@ -8464,7 +8464,7 @@ int JS_SetPropertyInternal(JSContext *ctx, JSValueConst obj,
goto read_only_prop;
}
}
-
+
for(;;) {
if (p1->is_exotic) {
if (p1->fast_array) {
@@ -9415,7 +9415,7 @@ static BOOL js_object_has_name(JSContext *ctx, JSValueConst obj)
JSShapeProperty *prs;
JSValueConst val;
JSString *p;
-
+
prs = find_own_property(&pr, JS_VALUE_GET_OBJ(obj), JS_ATOM_name);
if (!prs)
return FALSE;
@@ -9675,7 +9675,7 @@ static int JS_SetGlobalVar(JSContext *ctx, JSAtom prop, JSValue val,
return 0;
}
flags = JS_PROP_THROW_STRICT;
- if (is_strict_mode(ctx))
+ if (is_strict_mode(ctx))
flags |= JS_PROP_NO_ADD;
return JS_SetPropertyInternal(ctx, ctx->global_obj, prop, val, ctx->global_obj, flags);
}
@@ -9688,7 +9688,7 @@ int JS_DeleteProperty(JSContext *ctx, JSValueConst obj, JSAtom prop, int flags)
JSValue obj1;
JSObject *p;
int res;
-
+
obj1 = JS_ToObject(ctx, obj);
if (JS_IsException(obj1))
return -1;
@@ -9935,7 +9935,7 @@ static inline BOOL JS_IsHTMLDDA(JSContext *ctx, JSValueConst obj)
p = JS_VALUE_GET_OBJ(obj);
return p->is_HTMLDDA;
}
-
+
static int JS_ToBoolFree(JSContext *ctx, JSValue val)
{
uint32_t tag = JS_VALUE_GET_TAG(val);
@@ -9957,7 +9957,7 @@ static int JS_ToBoolFree(JSContext *ctx, JSValue val)
case JS_TAG_BIG_INT:
#ifdef CONFIG_BIGNUM
case JS_TAG_BIG_FLOAT:
-#endif
+#endif
{
JSBigFloat *p = JS_VALUE_GET_PTR(val);
BOOL ret;
@@ -10039,12 +10039,12 @@ static double js_strtod(const char *str, int radix, BOOL is_float)
{
double d;
int c;
-
+
if (!is_float || radix != 10) {
const char *p = str;
uint64_t n_max, n;
int int_exp, is_neg;
-
+
is_neg = 0;
if (*p == '-') {
is_neg = 1;
@@ -10095,7 +10095,7 @@ static double js_strtod(const char *str, int radix, BOOL is_float)
/* accept _ between digits as a digit separator */
#define ATOD_ACCEPT_UNDERSCORES (1 << 5)
/* allow a suffix to override the type */
-#define ATOD_ACCEPT_SUFFIX (1 << 6)
+#define ATOD_ACCEPT_SUFFIX (1 << 6)
/* default type */
#define ATOD_TYPE_MASK (3 << 7)
#define ATOD_TYPE_FLOAT64 (0 << 7)
@@ -10105,7 +10105,7 @@ static double js_strtod(const char *str, int radix, BOOL is_float)
#define ATOD_TYPE_BIG_DECIMAL (3 << 7)
/* assume bigint mode: floats are parsed as integers if no decimal
point nor exponent */
-#define ATOD_MODE_BIGINT (1 << 9)
+#define ATOD_MODE_BIGINT (1 << 9)
#endif
/* accept -0x1 */
#define ATOD_ACCEPT_PREFIX_AFTER_SIGN (1 << 10)
@@ -10140,7 +10140,7 @@ static JSValue js_string_to_bigfloat(JSContext *ctx, const char *buf,
bf_t *a;
int ret;
JSValue val;
-
+
val = JS_NewBigFloat(ctx);
if (JS_IsException(val))
return val;
@@ -10166,7 +10166,7 @@ static JSValue js_string_to_bigdecimal(JSContext *ctx, const char *buf,
bfdec_t *a;
int ret;
JSValue val;
-
+
val = JS_NewBigDecimal(ctx);
if (JS_IsException(val))
return val;
@@ -10199,11 +10199,11 @@ static JSValue js_atof(JSContext *ctx, const char *str, const char **pp,
int i, j, len;
BOOL buf_allocated = FALSE;
JSValue val;
-
+
/* optional separator between digits */
sep = (flags & ATOD_ACCEPT_UNDERSCORES) ? '_' : 256;
has_legacy_octal = FALSE;
-
+
p = str;
p_start = p;
is_neg = 0;
@@ -10256,7 +10256,7 @@ static JSValue js_atof(JSContext *ctx, const char *str, const char **pp,
(atod_type == ATOD_TYPE_FLOAT64
#ifdef CONFIG_BIGNUM
|| atod_type == ATOD_TYPE_BIG_FLOAT
-#endif
+#endif
) &&
strstart(p, "Infinity", &p)) {
#ifdef CONFIG_BIGNUM
@@ -10369,7 +10369,7 @@ static JSValue js_atof(JSContext *ctx, const char *str, const char **pp,
if (has_legacy_octal)
goto fail;
} else
-#endif
+#endif
{
if (is_float && radix != 10)
goto fail;
@@ -10403,11 +10403,11 @@ static JSValue js_atof(JSContext *ctx, const char *str, const char **pp,
goto fail;
val = ctx->rt->bigdecimal_ops.from_string(ctx, buf, radix, flags, NULL);
break;
-#endif
+#endif
default:
abort();
}
-
+
done:
if (buf_allocated)
js_free_rt(ctx->rt, buf);
@@ -10489,7 +10489,7 @@ static JSValue JS_ToNumberHintFree(JSContext *ctx, JSValue val,
const char *str;
const char *p;
size_t len;
-
+
str = JS_ToCStringLen(ctx, &len, val);
JS_FreeValue(ctx, val);
if (!str)
@@ -11044,7 +11044,7 @@ static __exception int JS_ToArrayLengthFree(JSContext *ctx, uint32_t *plen,
case JS_TAG_BIG_INT:
#ifdef CONFIG_BIGNUM
case JS_TAG_BIG_FLOAT:
-#endif
+#endif
{
JSBigFloat *p = JS_VALUE_GET_PTR(val);
bf_t a;
@@ -11830,7 +11830,7 @@ static __maybe_unused void JS_DumpObject(JSRuntime *rt, JSObject *p)
}
printf(" }");
}
-
+
if (js_class_has_bytecode(p->class_id)) {
JSFunctionBytecode *b = p->u.func.function_bytecode;
JSVarRef **var_refs;
@@ -12077,7 +12077,7 @@ static JSValue JS_StringToBigInt(JSContext *ctx, JSValue val)
const char *str, *p;
size_t len;
int flags;
-
+
str = JS_ToCStringLen(ctx, &len, val);
JS_FreeValue(ctx, val);
if (!str)
@@ -12091,7 +12091,7 @@ static JSValue JS_StringToBigInt(JSContext *ctx, JSValue val)
#ifdef CONFIG_BIGNUM
if (is_math_mode(ctx))
flags |= ATOD_MODE_BIGINT;
-#endif
+#endif
val = js_atof(ctx, p, &p, 0, flags);
p += skip_spaces(p);
if (!JS_IsException(val)) {
@@ -12165,7 +12165,7 @@ static bf_t *JS_ToBigIntFree(JSContext *ctx, bf_t *buf, JSValue val)
bf_rint(r, BF_RNDZ);
JS_FreeValue(ctx, val);
break;
-#endif
+#endif
case JS_TAG_STRING:
val = JS_StringToBigIntErr(ctx, val);
if (JS_IsException(val))
@@ -12197,7 +12197,7 @@ static __maybe_unused JSValue JS_ToBigIntValueFree(JSContext *ctx, JSValue val)
} else {
bf_t a_s, *a, *r;
int ret;
- JSValue res;
+ JSValue res;
res = JS_NewBigInt(ctx);
if (JS_IsException(res))
@@ -12277,7 +12277,7 @@ static JSValue JS_CompactBigInt1(JSContext *ctx, JSValue val,
{
int64_t v;
bf_t *a;
-
+
if (JS_VALUE_GET_TAG(val) != JS_TAG_BIG_INT)
return val; /* fail safe */
a = JS_GetBigInt(val);
@@ -12369,7 +12369,7 @@ static bfdec_t *JS_ToBigDecimal(JSContext *ctx, JSValueConst val)
uint32_t tag;
JSBigDecimal *p;
bfdec_t *r;
-
+
tag = JS_VALUE_GET_NORM_TAG(val);
switch(tag) {
case JS_TAG_BIG_DECIMAL:
@@ -12509,10 +12509,10 @@ static __exception int js_call_binary_op_fallback(JSContext *ctx,
JSOverloadableOperatorEnum ovop;
JSObject *p;
JSValueConst args[2];
-
+
if (!ctx->allow_operator_overloading)
return 0;
-
+
opset2_obj = JS_UNDEFINED;
opset1_obj = JS_GetProperty(ctx, op1, JS_ATOM_Symbol_operatorSet);
if (JS_IsException(opset1_obj))
@@ -12541,7 +12541,7 @@ static __exception int js_call_binary_op_fallback(JSContext *ctx,
}
ovop = get_ovop_from_opcode(op);
-
+
if (opset1->operator_counter == opset2->operator_counter) {
p = opset1->self_ops[ovop];
} else if (opset1->operator_counter > opset2->operator_counter) {
@@ -12566,7 +12566,7 @@ static __exception int js_call_binary_op_fallback(JSContext *ctx,
} else {
new_op1 = JS_DupValue(ctx, op1);
}
-
+
if (opset2->is_primitive) {
if (is_numeric) {
new_op2 = JS_ToNumeric(ctx, op2);
@@ -12583,7 +12583,7 @@ static __exception int js_call_binary_op_fallback(JSContext *ctx,
/* XXX: could apply JS_ToPrimitive() if primitive type so that the
operator function does not get a value object */
-
+
method = JS_DupValue(ctx, JS_MKPTR(JS_TAG_OBJECT, p));
if (ovop == JS_OVOP_LESS && (op == OP_lte || op == OP_gt)) {
args[0] = new_op2;
@@ -12694,7 +12694,7 @@ static __exception int js_call_unary_op_fallback(JSContext *ctx,
if (!ctx->allow_operator_overloading)
return 0;
-
+
opset1_obj = JS_GetProperty(ctx, op1, JS_ATOM_Symbol_operatorSet);
if (JS_IsException(opset1_obj))
goto exception;
@@ -12735,7 +12735,7 @@ static int js_unary_arith_bigfloat(JSContext *ctx,
bf_t a_s, *r, *a;
int ret, v;
JSValue res;
-
+
if (op == OP_plus && !is_math_mode(ctx)) {
JS_ThrowTypeError(ctx, "bigfloat argument with unary +");
JS_FreeValue(ctx, op1);
@@ -12789,7 +12789,7 @@ static int js_unary_arith_bigdecimal(JSContext *ctx,
bfdec_t *r, *a;
int ret, v;
JSValue res;
-
+
if (op == OP_plus && !is_math_mode(ctx)) {
JS_ThrowTypeError(ctx, "bigdecimal argument with unary +");
JS_FreeValue(ctx, op1);
@@ -12843,7 +12843,7 @@ static int js_unary_arith_bigint(JSContext *ctx,
bf_t a_s, *r, *a;
int ret, v;
JSValue res;
-
+
if (op == OP_plus && !is_math_mode(ctx)) {
JS_ThrowTypeError(ctx, "bigint argument with unary +");
JS_FreeValue(ctx, op1);
@@ -12964,7 +12964,7 @@ static no_inline __exception int js_unary_arith_slow(JSContext *ctx,
if (ctx->rt->bigdecimal_ops.unary_arith(ctx, sp - 1, op, op1))
goto exception;
break;
-#endif
+#endif
default:
handle_float64:
{
@@ -13016,7 +13016,7 @@ static __exception int js_post_inc_slow(JSContext *ctx,
static no_inline int js_not_slow(JSContext *ctx, JSValue *sp)
{
JSValue op1;
-
+
op1 = sp[-1];
#ifdef CONFIG_BIGNUM
if (JS_IsObject(op1)) {
@@ -13055,7 +13055,7 @@ static int js_binary_arith_bigint(JSContext *ctx, OPCodeEnum op,
bf_t a_s, b_s, *r, *a, *b;
int ret;
JSValue res;
-
+
res = JS_NewBigInt(ctx);
if (JS_IsException(res))
goto fail;
@@ -13096,7 +13096,7 @@ static int js_binary_arith_bigint(JSContext *ctx, OPCodeEnum op,
ret = bf_rem(r, a, b, BF_PREC_INF, BF_RNDZ,
BF_DIVREM_EUCLIDIAN) & BF_ST_INVALID_OP;
break;
-#endif
+#endif
case OP_mod:
ret = bf_rem(r, a, b, BF_PREC_INF, BF_RNDZ,
BF_RNDZ) & BF_ST_INVALID_OP;
@@ -13217,7 +13217,7 @@ static int js_binary_arith_bigfloat(JSContext *ctx, OPCodeEnum op,
bf_t a_s, b_s, *r, *a, *b;
int ret;
JSValue res;
-
+
res = JS_NewBigFloat(ctx);
if (JS_IsException(res))
goto fail;
@@ -13321,7 +13321,7 @@ static int js_binary_arith_bigdecimal(JSContext *ctx, OPCodeEnum op,
if (JS_IsException(res))
goto fail;
r = JS_GetBigDecimal(res);
-
+
a = JS_ToBigDecimal(ctx, op1);
if (!a)
goto fail;
@@ -13461,7 +13461,7 @@ static no_inline __exception int js_binary_arith_slow(JSContext *ctx, JSValue *s
v += v2;
}
break;
-#endif
+#endif
case OP_mod:
if (v1 < 0 || v2 <= 0) {
sp[-2] = JS_NewFloat64(ctx, fmod(v1, v2));
@@ -13491,7 +13491,7 @@ static no_inline __exception int js_binary_arith_slow(JSContext *ctx, JSValue *s
if (ctx->rt->bigfloat_ops.binary_arith(ctx, op, sp - 2, op1, op2))
goto exception;
} else
-#endif
+#endif
if (tag1 == JS_TAG_BIG_INT || tag2 == JS_TAG_BIG_INT) {
handle_bigint:
if (ctx->rt->bigint_ops.binary_arith(ctx, op, sp - 2, op1, op2))
@@ -13529,7 +13529,7 @@ static no_inline __exception int js_binary_arith_slow(JSContext *ctx, JSValue *s
if (dr < 0)
dr += d2;
break;
-#endif
+#endif
case OP_pow:
dr = js_pow(d1, d2);
break;
@@ -13639,7 +13639,7 @@ static no_inline __exception int js_add_slow(JSContext *ctx, JSValue *sp)
if (ctx->rt->bigfloat_ops.binary_arith(ctx, OP_add, sp - 2, op1, op2))
goto exception;
} else
-#endif
+#endif
if (tag1 == JS_TAG_BIG_INT || tag2 == JS_TAG_BIG_INT) {
handle_bigint:
if (ctx->rt->bigint_ops.binary_arith(ctx, OP_add, sp - 2, op1, op2))
@@ -13766,7 +13766,7 @@ static int js_compare_bigfloat(JSContext *ctx, OPCodeEnum op,
{
bf_t a_s, b_s, *a, *b;
int res;
-
+
a = JS_ToBigFloat(ctx, &a_s, op1);
if (!a) {
JS_FreeValue(ctx, op2);
@@ -13829,7 +13829,7 @@ static int js_compare_bigdecimal(JSContext *ctx, OPCodeEnum op,
}
a = JS_ToBigDecimal(ctx, op1); /* cannot fail */
b = JS_ToBigDecimal(ctx, op2); /* cannot fail */
-
+
switch(op) {
case OP_lt:
res = bfdec_cmp_lt(a, b); /* if NaN return false */
@@ -13886,7 +13886,7 @@ static no_inline int js_relational_slow(JSContext *ctx, JSValue *sp,
}
}
}
-#endif
+#endif
op1 = JS_ToPrimitiveFree(ctx, op1, HINT_NUMBER);
if (JS_IsException(op1)) {
JS_FreeValue(ctx, op2);
@@ -13971,7 +13971,7 @@ static no_inline int js_relational_slow(JSContext *ctx, JSValue *sp,
if (res < 0)
goto exception;
} else
-#endif
+#endif
if (tag1 == JS_TAG_BIG_INT || tag2 == JS_TAG_BIG_INT) {
res = ctx->rt->bigint_ops.compare(ctx, op, op1, op2);
if (res < 0)
@@ -14072,7 +14072,7 @@ static no_inline __exception int js_eq_slow(JSContext *ctx, JSValue *sp,
if (res < 0)
goto exception;
} else
-#endif
+#endif
{
res = ctx->rt->bigint_ops.compare(ctx, OP_eq, op1, op2);
if (res < 0)
@@ -14096,7 +14096,7 @@ static no_inline __exception int js_eq_slow(JSContext *ctx, JSValue *sp,
}
}
}
-#endif
+#endif
res = js_strict_eq2(ctx, op1, op2, JS_EQ_STRICT);
} else if ((tag1 == JS_TAG_NULL && tag2 == JS_TAG_UNDEFINED) ||
(tag2 == JS_TAG_NULL && tag1 == JS_TAG_UNDEFINED)) {
@@ -14238,7 +14238,7 @@ static JSValue js_mul_pow10_to_float64(JSContext *ctx, const bf_t *a,
bf_t r_s, *r = &r_s;
double d;
int ret;
-
+
/* always convert to Float64 */
bf_init(ctx->bf_ctx, r);
ret = bf_mul_pow_radix(r, a, 10, exponent,
@@ -14611,7 +14611,7 @@ static __exception int js_operator_typeof(JSContext *ctx, JSValueConst op1)
{
JSObject *p;
p = JS_VALUE_GET_OBJ(op1);
- if (unlikely(p->is_HTMLDDA))
+ if (unlikely(p->is_HTMLDDA))
atom = JS_ATOM_undefined;
else if (JS_IsFunction(ctx, op1))
atom = JS_ATOM_function;
@@ -14919,7 +14919,7 @@ static __exception int js_for_in_prepare_prototype_chain_enum(JSContext *ctx,
JSPropertyEnum *tab_atom;
uint32_t tab_atom_count, i;
JSValue obj1;
-
+
p = JS_VALUE_GET_OBJ(enum_obj);
it = p->u.for_in_iterator;
@@ -14963,7 +14963,7 @@ static __exception int js_for_in_prepare_prototype_chain_enum(JSContext *ctx,
it->tab_atom = tab_atom;
it->atom_count = tab_atom_count;
}
-
+
for(i = 0; i < it->atom_count; i++) {
if (JS_DefinePropertyValue(ctx, enum_obj, it->tab_atom[i].atom, JS_NULL, JS_PROP_ENUMERABLE) < 0)
goto fail;
@@ -15379,7 +15379,7 @@ static __exception int js_append_enumerate(JSContext *ctx, JSValue *sp)
int is_array_iterator;
JSValue *arrp;
uint32_t i, count32, pos;
-
+
if (JS_VALUE_GET_TAG(sp[-2]) != JS_TAG_INT) {
JS_ThrowInternalError(ctx, "invalid index for append");
return -1;
@@ -15467,7 +15467,7 @@ static __exception int JS_CopyDataProperties(JSContext *ctx,
int ret, gpn_flags;
JSPropertyDescriptor desc;
BOOL is_enumerable;
-
+
if (JS_VALUE_GET_TAG(source) != JS_TAG_OBJECT)
return 0;
@@ -15488,7 +15488,7 @@ static __exception int JS_CopyDataProperties(JSContext *ctx,
if (JS_GetOwnPropertyNamesInternal(ctx, &tab_atom, &tab_atom_count, p,
gpn_flags))
return -1;
-
+
for (i = 0; i < tab_atom_count; i++) {
if (pexcl) {
ret = JS_GetOwnPropertyInternal(ctx, NULL, pexcl, tab_atom[i].atom);
@@ -15868,7 +15868,7 @@ static JSValue js_call_c_function(JSContext *ctx, JSValueConst func_obj,
sf->prev_frame = prev_sf;
rt->current_stack_frame = sf;
ctx = p->u.cfunc.realm; /* change the current realm */
-
+
#ifdef CONFIG_BIGNUM
/* we only propagate the bignum mode as some runtime functions
test it */
@@ -16057,7 +16057,7 @@ static JSValue JS_CallInternal(JSContext *caller_ctx, JSValueConst func_obj,
#define DEF(id, size, n_pop, n_push, f) && case_OP_ ## id,
#if SHORT_OPCODES
#define def(id, size, n_pop, n_push, f)
-#else
+#else
#define def(id, size, n_pop, n_push, f) && case_default,
#endif
#include "quickjs-opcode.h"
@@ -16151,7 +16151,7 @@ static JSValue JS_CallInternal(JSContext *caller_ctx, JSValueConst func_obj,
sf->prev_frame = rt->current_stack_frame;
rt->current_stack_frame = sf;
ctx = b->realm; /* set the current realm */
-
+
restart:
for(;;) {
int call_argc;
@@ -16608,7 +16608,7 @@ static JSValue JS_CallInternal(JSContext *caller_ctx, JSValueConst func_obj,
JS_FreeValue(ctx, sp[-1]);
sp -= 2;
BREAK;
-
+
CASE(OP_throw):
JS_Throw(ctx, *--sp);
goto exception;
@@ -17431,7 +17431,7 @@ static JSValue JS_CallInternal(JSContext *caller_ctx, JSValueConst func_obj,
{
JSAtom atom;
JSValue val;
-
+
atom = get_u32(pc);
pc += 4;
val = JS_NewSymbolFromAtom(ctx, atom, JS_ATOM_TYPE_PRIVATE);
@@ -17440,7 +17440,7 @@ static JSValue JS_CallInternal(JSContext *caller_ctx, JSValueConst func_obj,
*sp++ = val;
}
BREAK;
-
+
CASE(OP_get_private_field):
{
JSValue val;
@@ -17593,7 +17593,7 @@ static JSValue JS_CallInternal(JSContext *caller_ctx, JSValueConst func_obj,
{
int class_flags;
JSAtom atom;
-
+
atom = get_u32(pc);
class_flags = pc[4];
pc += 5;
@@ -18590,7 +18590,7 @@ static JSContext *JS_GetFunctionRealm(JSContext *ctx, JSValueConst func_obj)
{
JSObject *p;
JSContext *realm;
-
+
if (JS_VALUE_GET_TAG(func_obj) != JS_TAG_OBJECT)
return ctx;
p = JS_VALUE_GET_OBJ(func_obj);
@@ -18639,7 +18639,7 @@ static JSValue js_create_from_ctor(JSContext *ctx, JSValueConst ctor,
{
JSValue proto, obj;
JSContext *realm;
-
+
if (JS_IsUndefined(ctor)) {
proto = JS_DupValue(ctx, ctx->class_proto[class_id]);
} else {
@@ -18846,7 +18846,7 @@ static void __async_func_free(JSRuntime *rt, JSAsyncFunctionState *s)
if (!s->is_completed) {
async_func_free_frame(rt, s);
}
-
+
JS_FreeValueRT(rt, s->resolving_funcs[0]);
JS_FreeValueRT(rt, s->resolving_funcs[1]);
@@ -19127,7 +19127,7 @@ static void js_async_function_resume(JSContext *ctx, JSAsyncFunctionState *s)
JS_FreeValue(ctx, promise);
goto fail;
}
-
+
/* Note: no need to create 'thrownawayCapability' as in
the spec */
for(i = 0; i < 2; i++)
@@ -19187,7 +19187,7 @@ static JSValue js_async_function_call(JSContext *ctx, JSValueConst func_obj,
}
js_async_function_resume(ctx, s);
-
+
async_func_free(ctx->rt, s);
return promise;
@@ -19218,7 +19218,7 @@ typedef struct JSAsyncGeneratorData {
JSObject *generator; /* back pointer to the object (const) */
JSAsyncGeneratorStateEnum state;
/* func_state is NULL is state AWAITING_RETURN and COMPLETED */
- JSAsyncFunctionState *func_state;
+ JSAsyncFunctionState *func_state;
struct list_head queue; /* list of JSAsyncGeneratorRequest.link */
} JSAsyncGeneratorData;
@@ -19862,7 +19862,7 @@ typedef struct JSFunctionDef {
int var_object_idx; /* -1 if none */
int arg_var_object_idx; /* -1 if none (var object for the argument scope) */
int arguments_var_idx; /* -1 if none */
- int arguments_arg_idx; /* argument variable definition in argument scope,
+ int arguments_arg_idx; /* argument variable definition in argument scope,
-1 if none */
int func_var_idx; /* variable containing the current function (-1
if none, only used if is_func_expr is true) */
@@ -19872,7 +19872,7 @@ typedef struct JSFunctionDef {
int this_active_func_var_idx; /* variable containg the 'this.active_func' value, -1 if none */
int home_object_var_idx;
BOOL need_home_object;
-
+
int scope_level; /* index into fd->scopes if the current lexical scope */
int scope_first; /* index into vd->vars of first lexically scoped variable */
int scope_size; /* allocated size of fd->scopes array */
@@ -19889,7 +19889,7 @@ typedef struct JSFunctionDef {
int last_opcode_pos; /* -1 if no last opcode */
int last_opcode_line_num;
BOOL use_short_opcodes; /* true if short opcodes are used in byte_code */
-
+
LabelSlot *label_slots;
int label_size; /* allocated size for label_slots[] */
int label_count;
@@ -20103,7 +20103,7 @@ int __attribute__((format(printf, 2, 3))) js_parse_error(JSParseState *s, const
JSContext *ctx = s->ctx;
va_list ap;
int backtrace_flags;
-
+
va_start(ap, fmt);
JS_ThrowError2(ctx, JS_SYNTAX_ERROR, fmt, ap, FALSE);
va_end(ap);
@@ -20453,7 +20453,7 @@ static __exception int ident_realloc(JSContext *ctx, char **pbuf, size_t *psize,
{
char *buf, *new_buf;
size_t size, new_size;
-
+
buf = *pbuf;
size = *psize;
if (size >= (SIZE_MAX / 3) * 2)
@@ -20525,7 +20525,7 @@ static JSAtom parse_ident(JSParseState *s, const uint8_t **pp,
char ident_buf[128], *buf;
size_t ident_size, ident_pos;
JSAtom atom;
-
+
p = *pp;
buf = ident_buf;
ident_size = sizeof(ident_buf);
@@ -20534,7 +20534,7 @@ static JSAtom parse_ident(JSParseState *s, const uint8_t **pp,
buf[ident_pos++] = '#';
for(;;) {
p1 = p;
-
+
if (c < 128) {
buf[ident_pos++] = c;
} else {
@@ -20572,11 +20572,11 @@ static __exception int next_token(JSParseState *s)
int c;
BOOL ident_has_escape;
JSAtom atom;
-
+
if (js_check_stack_overflow(s->ctx->rt, 0)) {
return js_parse_error(s, "stack overflow");
}
-
+
free_token(s, &s->token);
p = s->last_ptr = s->buf_ptr;
@@ -20703,14 +20703,14 @@ static __exception int next_token(JSParseState *s)
case 'm': case 'n': case 'o': case 'p':
case 'q': case 'r': case 's': case 't':
case 'u': case 'v': case 'w': case 'x':
- case 'y': case 'z':
+ case 'y': case 'z':
case 'A': case 'B': case 'C': case 'D':
case 'E': case 'F': case 'G': case 'H':
case 'I': case 'J': case 'K': case 'L':
case 'M': case 'N': case 'O': case 'P':
case 'Q': case 'R': case 'S': case 'T':
case 'U': case 'V': case 'W': case 'X':
- case 'Y': case 'Z':
+ case 'Y': case 'Z':
case '_':
case '$':
/* identifier */
@@ -20772,7 +20772,7 @@ static __exception int next_token(JSParseState *s)
goto parse_number;
case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8':
- case '9':
+ case '9':
/* number */
parse_number:
{
@@ -21030,7 +21030,7 @@ static __exception int next_token(JSParseState *s)
case CP_LS:
/* XXX: should avoid incrementing line_number, but
needed to handle HTML comments */
- goto line_terminator;
+ goto line_terminator;
default:
if (lre_is_space(c)) {
goto redo;
@@ -21065,7 +21065,7 @@ static JSAtom json_parse_ident(JSParseState *s, const uint8_t **pp, int c)
char ident_buf[128], *buf;
size_t ident_size, ident_pos;
JSAtom atom;
-
+
p = *pp;
buf = ident_buf;
ident_size = sizeof(ident_buf);
@@ -21097,11 +21097,11 @@ static __exception int json_next_token(JSParseState *s)
const uint8_t *p;
int c;
JSAtom atom;
-
+
if (js_check_stack_overflow(s->ctx->rt, 0)) {
return js_parse_error(s, "stack overflow");
}
-
+
free_token(s, &s->token);
p = s->last_ptr = s->buf_ptr;
@@ -21211,14 +21211,14 @@ static __exception int json_next_token(JSParseState *s)
case 'm': case 'n': case 'o': case 'p':
case 'q': case 'r': case 's': case 't':
case 'u': case 'v': case 'w': case 'x':
- case 'y': case 'z':
+ case 'y': case 'z':
case 'A': case 'B': case 'C': case 'D':
case 'E': case 'F': case 'G': case 'H':
case 'I': case 'J': case 'K': case 'L':
case 'M': case 'N': case 'O': case 'P':
case 'Q': case 'R': case 'S': case 'T':
case 'U': case 'V': case 'W': case 'X':
- case 'Y': case 'Z':
+ case 'Y': case 'Z':
case '_':
case '$':
/* identifier : only pure ascii characters are accepted */
@@ -21245,7 +21245,7 @@ static __exception int json_next_token(JSParseState *s)
goto parse_number;
case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8':
- case '9':
+ case '9':
/* number */
parse_number:
{
@@ -21293,7 +21293,7 @@ static int simple_next_token(const uint8_t **pp, BOOL no_line_terminator)
{
const uint8_t *p;
uint32_t c;
-
+
/* skip spaces and comments */
p = *pp;
for (;;) {
@@ -21559,7 +21559,7 @@ static int emit_goto(JSParseState *s, int opcode, int label)
static int cpool_add(JSParseState *s, JSValue val)
{
JSFunctionDef *fd = s->cur_func;
-
+
if (js_resize_array(s->ctx, (void *)&fd->cpool, sizeof(fd->cpool[0]),
&fd->cpool_size, fd->cpool_count + 1))
return -1;
@@ -21945,7 +21945,7 @@ static int define_var(JSParseState *s, JSFunctionDef *fd, JSAtom name,
if (find_var_in_child_scope(ctx, fd, name, fd->scope_level) >= 0) {
return js_parse_error(s, "invalid redefinition of a variable");
}
-
+
if (fd->is_global_var) {
JSGlobalVar *hf;
hf = find_global_var(fd, name);
@@ -21954,7 +21954,7 @@ static int define_var(JSParseState *s, JSFunctionDef *fd, JSAtom name,
return js_parse_error(s, "invalid redefinition of global identifier");
}
}
-
+
if (fd->is_eval &&
(fd->eval_type == JS_EVAL_TYPE_GLOBAL ||
fd->eval_type == JS_EVAL_TYPE_MODULE) &&
@@ -22226,7 +22226,7 @@ static int __exception js_parse_property_name(JSParseState *s,
BOOL is_non_reserved_ident;
JSAtom name;
int prop_type;
-
+
prop_type = PROP_TYPE_IDENT;
if (allow_method) {
if (token_is_pseudo_keyword(s, JS_ATOM_get)
@@ -22452,7 +22452,7 @@ static int js_parse_skip_parens_token(JSParseState *s, int *pbits, BOOL no_line_
if (level >= sizeof(state))
goto done;
state[level++] = '`';
- }
+ }
break;
case TOK_EOF:
goto done;
@@ -22469,7 +22469,7 @@ static int js_parse_skip_parens_token(JSParseState *s, int *pbits, BOOL no_line_
case '=':
bits |= SKIP_HAS_ASSIGNMENT;
break;
-
+
case TOK_DIV_ASSIGN:
tok_len = 2;
goto parse_regexp;
@@ -22679,13 +22679,13 @@ static __exception int js_parse_object_literal(JSParseState *s)
}
/* allow the 'in' binary operator */
-#define PF_IN_ACCEPTED (1 << 0)
+#define PF_IN_ACCEPTED (1 << 0)
/* allow function calls parsing in js_parse_postfix_expr() */
-#define PF_POSTFIX_CALL (1 << 1)
+#define PF_POSTFIX_CALL (1 << 1)
/* allow the exponentiation operator in js_parse_unary() */
-#define PF_POW_ALLOWED (1 << 2)
+#define PF_POW_ALLOWED (1 << 2)
/* forbid the exponentiation operator in js_parse_unary() */
-#define PF_POW_FORBIDDEN (1 << 3)
+#define PF_POW_FORBIDDEN (1 << 3)
static __exception int js_parse_postfix_expr(JSParseState *s, int parse_flags);
@@ -22704,7 +22704,7 @@ static __exception int js_parse_class_default_ctor(JSParseState *s,
int ret, line_num;
JSParseFunctionEnum func_type;
const uint8_t *saved_buf_end;
-
+
js_parse_get_pos(s, &pos);
if (has_super) {
/* spec change: no argument evaluation */
@@ -22751,7 +22751,7 @@ static int find_private_class_field(JSContext *ctx, JSFunctionDef *fd,
static void emit_class_field_init(JSParseState *s)
{
int label_next;
-
+
emit_op(s, OP_scope_get_var);
emit_atom(s, JS_ATOM_class_fields_init);
emit_u16(s, s->cur_func->scope_level);
@@ -22759,13 +22759,13 @@ static void emit_class_field_init(JSParseState *s)
/* no need to call the class field initializer if not defined */
emit_op(s, OP_dup);
label_next = emit_goto(s, OP_if_false, -1);
-
+
emit_op(s, OP_scope_get_var);
emit_atom(s, JS_ATOM_this);
emit_u16(s, 0);
-
+
emit_op(s, OP_swap);
-
+
emit_op(s, OP_call_method);
emit_u16(s, 0);
@@ -22791,13 +22791,13 @@ static __exception int emit_class_init_start(JSParseState *s,
ClassFieldsDef *cf)
{
int label_add_brand;
-
+
cf->fields_init_fd = js_parse_function_class_fields_init(s);
if (!cf->fields_init_fd)
return -1;
s->cur_func = cf->fields_init_fd;
-
+
if (!cf->is_static) {
/* add the brand to the newly created instance */
/* XXX: would be better to add the code only if needed, maybe in a
@@ -22805,17 +22805,17 @@ static __exception int emit_class_init_start(JSParseState *s,
emit_op(s, OP_push_false); /* will be patched later */
cf->brand_push_pos = cf->fields_init_fd->last_opcode_pos;
label_add_brand = emit_goto(s, OP_if_false, -1);
-
+
emit_op(s, OP_scope_get_var);
emit_atom(s, JS_ATOM_this);
emit_u16(s, 0);
-
+
emit_op(s, OP_scope_get_var);
emit_atom(s, JS_ATOM_home_object);
emit_u16(s, 0);
-
+
emit_op(s, OP_add_brand);
-
+
emit_label(s, label_add_brand);
}
s->cur_func = s->cur_func->parent;
@@ -22829,7 +22829,7 @@ static void emit_class_init_end(JSParseState *s, ClassFieldsDef *cf)
s->cur_func = cf->fields_init_fd;
emit_op(s, OP_return_undef);
s->cur_func = s->cur_func->parent;
-
+
cpool_idx = cpool_add(s, JS_NULL);
cf->fields_init_fd->parent_cpool_idx = cpool_idx;
emit_op(s, OP_fclosure);
@@ -22915,7 +22915,7 @@ static __exception int js_parse_class(JSParseState *s, BOOL is_class_expr,
} else {
class_name1 = class_name;
}
-
+
emit_op(s, OP_define_class);
emit_atom(s, class_name1);
emit_u8(s, class_flags);
@@ -22928,7 +22928,7 @@ static __exception int js_parse_class(JSParseState *s, BOOL is_class_expr,
cf->need_brand = FALSE;
cf->is_static = i;
}
-
+
ctor_fd = NULL;
while (s->token.val != '}') {
if (s->token.val == ';') {
@@ -22993,7 +22993,7 @@ static __exception int js_parse_class(JSParseState *s, BOOL is_class_expr,
}
is_private = prop_type & PROP_TYPE_PRIVATE;
prop_type &= ~PROP_TYPE_PRIVATE;
-
+
if ((name == JS_ATOM_constructor && !is_static &&
prop_type != PROP_TYPE_IDENT) ||
(name == JS_ATOM_prototype && is_static) ||
@@ -23041,7 +23041,7 @@ static __exception int js_parse_class(JSParseState *s, BOOL is_class_expr,
if (is_set) {
JSAtom setter_name;
int ret;
-
+
setter_name = get_private_setter_name(ctx, name);
if (setter_name == JS_ATOM_NULL)
goto fail;
@@ -23067,7 +23067,7 @@ static __exception int js_parse_class(JSParseState *s, BOOL is_class_expr,
} else if (prop_type == PROP_TYPE_IDENT && s->token.val != '(') {
ClassFieldsDef *cf = &class_fields[is_static];
JSAtom field_var_name = JS_ATOM_NULL;
-
+
/* class field */
/* XXX: spec: not consistent with method name checks */
@@ -23075,7 +23075,7 @@ static __exception int js_parse_class(JSParseState *s, BOOL is_class_expr,
js_parse_error(s, "invalid field name");
goto fail;
}
-
+
if (is_private) {
if (find_private_class_field(ctx, fd, name,
fd->scope_level) >= 0) {
@@ -23125,7 +23125,7 @@ static __exception int js_parse_class(JSParseState *s, BOOL is_class_expr,
emit_atom(s, name);
emit_u16(s, s->cur_func->scope_level);
}
-
+
if (s->token.val == '=') {
if (next_token(s))
goto fail;
@@ -23152,7 +23152,7 @@ static __exception int js_parse_class(JSParseState *s, BOOL is_class_expr,
} else {
JSParseFunctionEnum func_type;
JSFunctionKindEnum func_kind;
-
+
func_type = JS_PARSE_FUNC_METHOD;
func_kind = JS_FUNC_NORMAL;
if (prop_type == PROP_TYPE_STAR) {
@@ -23248,7 +23248,7 @@ static __exception int js_parse_class(JSParseState *s, BOOL is_class_expr,
emit_op(s, OP_null);
emit_op(s, OP_swap);
emit_op(s, OP_add_brand);
-
+
/* define the brand field in 'this' of the initializer */
if (!cf->fields_init_fd) {
if (emit_class_init_start(s, cf))
@@ -23258,7 +23258,7 @@ static __exception int js_parse_class(JSParseState *s, BOOL is_class_expr,
OP_add_brand_instance code */
cf->fields_init_fd->byte_code.buf[cf->brand_push_pos] = OP_push_true;
}
-
+
/* store the function to initialize the fields to that it can be
referenced by the constructor */
var_idx = define_var(s, fd, JS_ATOM_class_fields_init,
@@ -23304,7 +23304,7 @@ static __exception int js_parse_class(JSParseState *s, BOOL is_class_expr,
emit_u16(s, 0);
emit_op(s, OP_drop);
}
-
+
pop_scope(s);
pop_scope(s);
@@ -23699,7 +23699,7 @@ static void put_lvalue(JSParseState *s, int opcode, int scope,
default:
break;
}
-
+
switch(opcode) {
case OP_scope_get_var: /* val -- */
assert(special == PUT_LVALUE_NOKEEP ||
@@ -23753,7 +23753,7 @@ static __exception int js_define_var(JSParseState *s, JSAtom name, int tok)
{
JSFunctionDef *fd = s->cur_func;
JSVarDefEnum var_def_type;
-
+
if (name == JS_ATOM_yield && fd->func_kind == JS_FUNC_GENERATOR) {
return js_parse_error(s, "yield is a reserved identifier");
}
@@ -23864,7 +23864,7 @@ static int js_parse_destructuring_element(JSParseState *s, int tok, int is_arg,
JSAtom prop_name, var_name;
int opcode, scope, tok1, skip_bits;
BOOL has_initializer;
-
+
if (has_ellipsis < 0) {
/* pre-parse destructuration target for spread detection */
js_parse_skip_parens_token(s, &skip_bits, FALSE);
@@ -24303,7 +24303,7 @@ static __exception int js_parse_postfix_expr(JSParseState *s, int parse_flags)
FuncCallType call_type;
int optional_chaining_label;
BOOL accept_lparen = (parse_flags & PF_POSTFIX_CALL) != 0;
-
+
call_type = FUNC_CALL_NORMAL;
switch(s->token.val) {
case TOK_NUMBER:
@@ -24359,7 +24359,7 @@ static __exception int js_parse_postfix_expr(JSParseState *s, int parse_flags)
if (next_token(s))
return -1;
break;
-
+
case TOK_DIV_ASSIGN:
s->buf_ptr -= 2;
goto parse_regexp;
@@ -24580,7 +24580,7 @@ static __exception int js_parse_postfix_expr(JSParseState *s, int parse_flags)
for(;;) {
JSFunctionDef *fd = s->cur_func;
BOOL has_optional_chain = FALSE;
-
+
if (s->token.val == TOK_QUESTION_MARK_DOT) {
/* optional chaining */
if (next_token(s))
@@ -25162,7 +25162,7 @@ static __exception int js_parse_unary(JSParseState *s, int parse_flags)
put_lvalue(s, opcode, scope, name, label, PUT_LVALUE_KEEP_SECOND,
FALSE);
if (next_token(s))
- return -1;
+ return -1;
}
break;
}
@@ -25421,7 +25421,7 @@ static __exception int js_parse_logical_and_or(JSParseState *s, int op,
static __exception int js_parse_coalesce_expr(JSParseState *s, int parse_flags)
{
int label1;
-
+
if (js_parse_logical_and_or(s, TOK_LOR, parse_flags))
return -1;
if (s->token.val == TOK_DOUBLE_QUESTION_MARK) {
@@ -25429,12 +25429,12 @@ static __exception int js_parse_coalesce_expr(JSParseState *s, int parse_flags)
for(;;) {
if (next_token(s))
return -1;
-
+
emit_op(s, OP_dup);
emit_op(s, OP_is_undefined_or_null);
emit_goto(s, OP_if_false, label1);
emit_op(s, OP_drop);
-
+
if (js_parse_expr_binary(s, 8, parse_flags))
return -1;
if (s->token.val != TOK_DOUBLE_QUESTION_MARK)
@@ -25485,7 +25485,7 @@ static __exception int js_parse_assign_expr2(JSParseState *s, int parse_flags)
if (s->token.val == TOK_YIELD) {
BOOL is_star = FALSE, is_async;
-
+
if (!(s->cur_func->func_kind & JS_FUNC_GENERATOR))
return js_parse_error(s, "unexpected 'yield' keyword");
if (!s->cur_func->in_function_body)
@@ -25523,9 +25523,9 @@ static __exception int js_parse_assign_expr2(JSParseState *s, int parse_flags)
undefined) */
emit_op(s, OP_drop);
emit_op(s, OP_undefined);
-
+
emit_op(s, OP_undefined); /* initial value */
-
+
emit_label(s, label_loop);
emit_op(s, OP_iterator_next);
if (is_async)
@@ -25548,13 +25548,13 @@ static __exception int js_parse_assign_expr2(JSParseState *s, int parse_flags)
label_return = emit_goto(s, OP_if_true, -1);
emit_op(s, OP_drop);
emit_goto(s, OP_goto, label_loop);
-
+
emit_label(s, label_return);
emit_op(s, OP_push_i32);
emit_u32(s, 2);
emit_op(s, OP_strict_eq);
label_throw = emit_goto(s, OP_if_true, -1);
-
+
/* return handling */
if (is_async)
emit_op(s, OP_await);
@@ -25570,13 +25570,13 @@ static __exception int js_parse_assign_expr2(JSParseState *s, int parse_flags)
emit_op(s, OP_get_field);
emit_atom(s, JS_ATOM_value);
-
+
emit_label(s, label_return1);
emit_op(s, OP_nip);
emit_op(s, OP_nip);
emit_op(s, OP_nip);
emit_return(s, TRUE);
-
+
/* throw handling */
emit_label(s, label_throw);
emit_op(s, OP_iterator_call);
@@ -25601,7 +25601,7 @@ static __exception int js_parse_assign_expr2(JSParseState *s, int parse_flags)
emit_op(s, OP_throw_error);
emit_atom(s, JS_ATOM_NULL);
emit_u8(s, JS_THROW_ERROR_ITERATOR_THROW);
-
+
emit_label(s, label_next);
emit_op(s, OP_get_field);
emit_atom(s, JS_ATOM_value);
@@ -25611,7 +25611,7 @@ static __exception int js_parse_assign_expr2(JSParseState *s, int parse_flags)
emit_op(s, OP_nip);
} else {
int label_next;
-
+
if (is_async)
emit_op(s, OP_await);
emit_op(s, OP_yield);
@@ -25620,7 +25620,7 @@ static __exception int js_parse_assign_expr2(JSParseState *s, int parse_flags)
emit_label(s, label_next);
}
return 0;
- } else if (s->token.val == '(' &&
+ } else if (s->token.val == '(' &&
js_parse_skip_parens_token(s, NULL, TRUE) == TOK_ARROW) {
return js_parse_function_decl(s, JS_PARSE_FUNC_ARROW,
JS_FUNC_NORMAL, JS_ATOM_NULL,
@@ -25704,7 +25704,7 @@ static __exception int js_parse_assign_expr2(JSParseState *s, int parse_flags)
put_lvalue(s, opcode, scope, name, label, PUT_LVALUE_KEEP_TOP, FALSE);
} else if (op >= TOK_LAND_ASSIGN && op <= TOK_DOUBLE_QUESTION_MARK_ASSIGN) {
int label, label1, depth_lvalue, label2;
-
+
if (next_token(s))
return -1;
if (get_lvalue(s, &opcode, &scope, &name, &label,
@@ -25717,7 +25717,7 @@ static __exception int js_parse_assign_expr2(JSParseState *s, int parse_flags)
label1 = emit_goto(s, op == TOK_LOR_ASSIGN ? OP_if_true : OP_if_false,
-1);
emit_op(s, OP_drop);
-
+
if (js_parse_assign_expr2(s, parse_flags)) {
JS_FreeAtom(s->ctx, name);
return -1;
@@ -25726,7 +25726,7 @@ static __exception int js_parse_assign_expr2(JSParseState *s, int parse_flags)
if (opcode == OP_get_ref_value && name == name0) {
set_object_name(s, name);
}
-
+
switch(depth_lvalue) {
case 1:
emit_op(s, OP_insert2);
@@ -25746,7 +25746,7 @@ static __exception int js_parse_assign_expr2(JSParseState *s, int parse_flags)
put_lvalue(s, opcode, scope, name, label, PUT_LVALUE_NOKEEP_DEPTH,
FALSE);
label2 = emit_goto(s, OP_goto, -1);
-
+
emit_label(s, label1);
/* remove the lvalue stack entries */
@@ -25882,7 +25882,7 @@ static void emit_return(JSParseState *s, BOOL hasval)
emit_op(s, OP_await);
}
}
-
+
top = s->cur_func->top_break;
while (top != NULL) {
if (top->has_iterator || top->label_finally != -1) {
@@ -26967,7 +26967,7 @@ static __exception int js_parse_statement_or_decl(JSParseState *s,
emit_label(s, label_finally);
if (s->token.val == TOK_FINALLY) {
int saved_eval_ret_idx = 0; /* avoid warning */
-
+
if (next_token(s))
goto fail;
/* on the stack: ret_value gosub_ret_value */
@@ -26987,7 +26987,7 @@ static __exception int js_parse_statement_or_decl(JSParseState *s,
emit_u16(s, saved_eval_ret_idx);
set_eval_ret_undefined(s);
}
-
+
if (js_parse_block(s))
goto fail;
@@ -27092,7 +27092,7 @@ static __exception int js_parse_statement_or_decl(JSParseState *s,
if (js_parse_expect_semi(s))
goto fail;
break;
-
+
case TOK_ENUM:
case TOK_EXPORT:
case TOK_EXTENDS:
@@ -27419,7 +27419,7 @@ static JSModuleDef *js_find_loaded_module(JSContext *ctx, JSAtom name)
{
struct list_head *el;
JSModuleDef *m;
-
+
/* first look at the loaded modules */
list_for_each(el, &ctx->loaded_modules) {
m = list_entry(el, JSModuleDef, link);
@@ -27484,7 +27484,7 @@ static JSModuleDef *js_host_resolve_imported_module_atom(JSContext *ctx,
{
const char *base_cname, *cname;
JSModuleDef *m;
-
+
base_cname = JS_AtomToCString(ctx, base_module_name);
if (!base_cname)
return NULL;
@@ -28020,7 +28020,7 @@ static int js_create_module_function(JSContext *ctx, JSModuleDef *m)
BOOL is_c_module;
int i;
JSVarRef *var_ref;
-
+
if (m->func_created)
return 0;
@@ -28044,7 +28044,7 @@ static int js_create_module_function(JSContext *ctx, JSModuleDef *m)
m->func_created = TRUE;
/* do it on the dependencies */
-
+
for(i = 0; i < m->req_module_entries_count; i++) {
JSReqModuleEntry *rme = &m->req_module_entries[i];
if (js_create_module_function(ctx, rme->module) < 0)
@@ -28052,9 +28052,9 @@ static int js_create_module_function(JSContext *ctx, JSModuleDef *m)
}
return 0;
-}
+}
+
-
/* Prepare a module to be executed by resolving all the imported
variables. */
static int js_inner_module_linking(JSContext *ctx, JSModuleDef *m,
@@ -28067,12 +28067,12 @@ static int js_inner_module_linking(JSContext *ctx, JSModuleDef *m,
JSObject *p;
BOOL is_c_module;
JSValue ret_val;
-
+
if (js_check_stack_overflow(ctx->rt, 0)) {
JS_ThrowStackOverflow(ctx);
return -1;
}
-
+
#ifdef DUMP_MODULE_RESOLVE
{
char buf1[ATOM_GET_STR_BUF_SIZE];
@@ -28347,7 +28347,7 @@ static JSValue js_import_meta(JSContext *ctx)
{
JSAtom filename;
JSModuleDef *m;
-
+
filename = JS_GetScriptOrModuleName(ctx, 0);
if (filename == JS_ATOM_NULL)
goto fail;
@@ -28375,7 +28375,7 @@ static JSValue js_load_module_rejected(JSContext *ctx, JSValueConst this_val,
JSValueConst *resolving_funcs = (JSValueConst *)func_data;
JSValueConst error;
JSValue ret;
-
+
/* XXX: check if the test is necessary */
if (argc >= 1)
error = argv[0];
@@ -28393,7 +28393,7 @@ static JSValue js_load_module_fulfilled(JSContext *ctx, JSValueConst this_val,
JSValueConst *resolving_funcs = (JSValueConst *)func_data;
JSModuleDef *m = JS_VALUE_GET_PTR(func_data[2]);
JSValue ret, ns;
-
+
/* return the module namespace */
ns = JS_GetModuleNamespace(ctx, m);
if (JS_IsException(ns)) {
@@ -28416,11 +28416,11 @@ static void JS_LoadModuleInternal(JSContext *ctx, const char *basename,
JSModuleDef *m;
JSValue ret, err, func_obj, evaluate_resolving_funcs[2];
JSValueConst func_data[3];
-
+
m = js_host_resolve_imported_module(ctx, basename, filename);
if (!m)
goto fail;
-
+
if (js_resolve_module(ctx, m) < 0) {
js_free_modules(ctx, JS_FREE_MODULE_NOT_RESOLVED);
goto fail;
@@ -28459,7 +28459,7 @@ JSValue JS_LoadModule(JSContext *ctx, const char *basename,
const char *filename)
{
JSValue promise, resolving_funcs[2];
-
+
promise = JS_NewPromiseCapability(ctx, resolving_funcs);
if (JS_IsException(promise))
return JS_EXCEPTION;
@@ -28490,7 +28490,7 @@ static JSValue js_dynamic_import_job(JSContext *ctx,
filename = JS_ToCString(ctx, specifier);
if (!filename)
goto exception;
-
+
JS_LoadModuleInternal(ctx, basename, filename,
resolving_funcs);
JS_FreeCString(ctx, filename);
@@ -28520,7 +28520,7 @@ static JSValue js_dynamic_import(JSContext *ctx, JSValueConst specifier)
JS_FreeAtom(ctx, basename);
if (JS_IsException(basename_val))
return basename_val;
-
+
promise = JS_NewPromiseCapability(ctx, resolving_funcs);
if (JS_IsException(promise)) {
JS_FreeValue(ctx, basename_val);
@@ -28531,7 +28531,7 @@ static JSValue js_dynamic_import(JSContext *ctx, JSValueConst specifier)
args[1] = resolving_funcs[1];
args[2] = basename_val;
args[3] = specifier;
-
+
/* cannot run JS_LoadModuleInternal synchronously because it would
cause an unexpected recursion in js_evaluate_module() */
JS_EnqueueJob(ctx, js_dynamic_import_job, 4, args);
@@ -28623,7 +28623,7 @@ static JSValue js_async_module_execution_rejected(JSContext *ctx, JSValueConst t
JSModuleDef *module = JS_VALUE_GET_PTR(func_data[0]);
JSValueConst error = argv[0];
int i;
-
+
if (js_check_stack_overflow(ctx->rt, 0))
return JS_ThrowStackOverflow(ctx);
@@ -28664,7 +28664,7 @@ static JSValue js_async_module_execution_fulfilled(JSContext *ctx, JSValueConst
JSModuleDef *module = JS_VALUE_GET_PTR(func_data[0]);
ExecModuleList exec_list_s, *exec_list = &exec_list_s;
int i;
-
+
if (module->status == JS_MODULE_STATUS_EVALUATED) {
assert(module->eval_has_exception);
return JS_UNDEFINED;
@@ -28687,7 +28687,7 @@ static JSValue js_async_module_execution_fulfilled(JSContext *ctx, JSValueConst
/* sort by increasing async_evaluation timestamp */
rqsort(exec_list->tab, exec_list->count, sizeof(exec_list->tab[0]),
exec_module_list_cmp, NULL);
-
+
for(i = 0; i < exec_list->count; i++) {
JSModuleDef *m = exec_list->tab[i];
if (m->status == JS_MODULE_STATUS_EVALUATED) {
@@ -28779,7 +28779,7 @@ static int js_inner_module_evaluation(JSContext *ctx, JSModuleDef *m,
*pvalue = JS_GetException(ctx);
return -1;
}
-
+
#ifdef DUMP_MODULE_RESOLVE
{
char buf1[ATOM_GET_STR_BUF_SIZE];
@@ -28811,12 +28811,12 @@ static int js_inner_module_evaluation(JSContext *ctx, JSModuleDef *m,
/* push 'm' on stack */
m->stack_prev = *pstack_top;
*pstack_top = m;
-
+
for(i = 0; i < m->req_module_entries_count; i++) {
JSReqModuleEntry *rme = &m->req_module_entries[i];
m1 = rme->module;
index = js_inner_module_evaluation(ctx, m1, index, pstack_top, pvalue);
- if (index < 0)
+ if (index < 0)
return -1;
assert(m1->status == JS_MODULE_STATUS_EVALUATING ||
m1->status == JS_MODULE_STATUS_EVALUATING_ASYNC ||
@@ -29280,7 +29280,7 @@ static __exception int js_parse_source_element(JSParseState *s)
{
JSFunctionDef *fd = s->cur_func;
int tok;
-
+
if (s->token.val == TOK_FUNCTION ||
(token_is_pseudo_keyword(s, JS_ATOM_async) &&
peek_token(s, TRUE) == TOK_FUNCTION)) {
@@ -29372,7 +29372,7 @@ static void free_bytecode_atoms(JSRuntime *rt,
int pos, len, op;
JSAtom atom;
const JSOpCode *oi;
-
+
pos = 0;
while (pos < bc_len) {
op = bc_buf[pos];
@@ -29380,7 +29380,7 @@ static void free_bytecode_atoms(JSRuntime *rt,
oi = &short_opcode_info(op);
else
oi = &opcode_info[op];
-
+
len = oi->size;
switch(oi->fmt) {
case OP_FMT_atom:
@@ -30163,7 +30163,7 @@ static void var_object_test(JSContext *ctx, JSFunctionDef *s,
update_label(s, *plabel_done, 1);
s->jump_size++;
}
-
+
/* return the position of the next opcode */
static int resolve_scope_var(JSContext *ctx, JSFunctionDef *s,
JSAtom var_name, int scope_level, int op,
@@ -30375,7 +30375,7 @@ static int resolve_scope_var(JSContext *ctx, JSFunctionDef *s,
is_arg_scope = (idx == ARG_SCOPE_END);
if (var_idx >= 0)
break;
-
+
if (!is_arg_scope) {
var_idx = find_var(ctx, fd, var_name);
if (var_idx >= 0)
@@ -30419,7 +30419,7 @@ static int resolve_scope_var(JSContext *ctx, JSFunctionDef *s,
dbuf_put_u16(bc, idx);
var_object_test(ctx, s, var_name, op, bc, &label_done, 0);
}
-
+
if (fd->is_eval)
break; /* it it necessarily the top level function */
}
@@ -30622,7 +30622,7 @@ static void get_loc_or_ref(DynBuf *bc, BOOL is_ref, int idx)
{
/* if the field is not initialized, the error is catched when
accessing it */
- if (is_ref)
+ if (is_ref)
dbuf_putc(bc, OP_get_var_ref);
else
dbuf_putc(bc, OP_get_loc);
@@ -30637,7 +30637,7 @@ static int resolve_scope_private_field1(JSContext *ctx,
int idx, var_kind;
JSFunctionDef *fd;
BOOL is_ref;
-
+
fd = s;
is_ref = FALSE;
for(;;) {
@@ -30969,7 +30969,7 @@ static __exception int add_closure_variables(JSContext *ctx, JSFunctionDef *s,
int i, count;
JSVarDef *vd;
BOOL is_arg_scope;
-
+
count = b->arg_count + b->var_count + b->closure_var_count;
s->closure_var = NULL;
s->closure_var_count = 0;
@@ -31203,7 +31203,7 @@ static void instantiate_hoisted_definitions(JSContext *ctx, JSFunctionDef *s, Dy
visible if there are cyclic module references */
if (s->module) {
label_next = new_label_fd(s, -1);
-
+
/* if 'this' is true, initialize the global variables and return */
dbuf_putc(bc, OP_push_this);
dbuf_putc(bc, OP_if_false);
@@ -31211,7 +31211,7 @@ static void instantiate_hoisted_definitions(JSContext *ctx, JSFunctionDef *s, Dy
update_label(s, label_next, 1);
s->jump_size++;
}
-
+
/* add the global variables (only happens if s->is_global_var is
true) */
for(i = 0; i < s->global_var_count; i++) {
@@ -31240,7 +31240,7 @@ static void instantiate_hoisted_definitions(JSContext *ctx, JSFunctionDef *s, Dy
}
if (!has_closure) {
int flags;
-
+
flags = 0;
if (s->eval_type != JS_EVAL_TYPE_GLOBAL)
flags |= JS_PROP_CONFIGURABLE;
@@ -31248,11 +31248,11 @@ static void instantiate_hoisted_definitions(JSContext *ctx, JSFunctionDef *s, Dy
/* global function definitions need a specific handling */
dbuf_putc(bc, OP_fclosure);
dbuf_put_u32(bc, hf->cpool_idx);
-
+
dbuf_putc(bc, OP_define_func);
dbuf_put_u32(bc, JS_DupAtom(ctx, hf->var_name));
dbuf_putc(bc, flags);
-
+
goto done_global_var;
} else {
if (hf->is_lexical) {
@@ -31296,7 +31296,7 @@ static void instantiate_hoisted_definitions(JSContext *ctx, JSFunctionDef *s, Dy
if (s->module) {
dbuf_putc(bc, OP_return_undef);
-
+
dbuf_putc(bc, OP_label);
dbuf_put_u32(bc, label_next);
s->label_slots[label_next].pos2 = bc->size;
@@ -31401,7 +31401,7 @@ static __exception int resolve_variables(JSContext *ctx, JSFunctionDef *s)
for(i = 0; i < s->global_var_count; i++) {
JSGlobalVar *hf = &s->global_vars[i];
int flags;
-
+
/* check if global variable (XXX: simplify) */
for(idx = 0; idx < s->closure_var_count; idx++) {
JSClosureVar *cv = &s->closure_var[idx];
@@ -31423,7 +31423,7 @@ static __exception int resolve_variables(JSContext *ctx, JSFunctionDef *s)
cv->var_name == JS_ATOM__arg_var_)
goto next;
}
-
+
dbuf_putc(&bc_out, OP_check_define_var);
dbuf_put_u32(&bc_out, JS_DupAtom(ctx, hf->var_name));
flags = 0;
@@ -31715,7 +31715,7 @@ static __exception int resolve_variables(JSContext *ctx, JSFunctionDef *s)
case OP_get_array_el_opt_chain: /* equivalent to OP_get_array_el */
dbuf_putc(&bc_out, OP_get_array_el);
break;
-
+
default:
no_change:
dbuf_put(&bc_out, bc_buf + pos, len);
@@ -32886,7 +32886,7 @@ static __exception int ss_check(JSContext *ctx, StackSizeState *s,
/* mark as explored and store the stack size */
s->stack_level_tab[pos] = stack_len;
s->catch_pos_tab[pos] = catch_pos;
-
+
/* queue the new PC to explore */
if (js_resize_array(ctx, (void **)&s->pc_stack, sizeof(s->pc_stack[0]),
&s->pc_stack_size, s->pc_stack_len + 1))
@@ -33342,7 +33342,7 @@ static JSValue js_create_function(JSContext *ctx, JSFunctionDef *fd)
b->realm = JS_DupContext(ctx);
add_gc_object(ctx->rt, &b->header, JS_GC_OBJ_TYPE_FUNCTION_BYTECODE);
-
+
#if defined(DUMP_BYTECODE) && (DUMP_BYTECODE & 1)
if (!(fd->js_mode & JS_MODE_STRIP)) {
js_dump_function_bytecode(ctx, b);
@@ -33554,7 +33554,7 @@ duplicate:
static JSFunctionDef *js_parse_function_class_fields_init(JSParseState *s)
{
JSFunctionDef *fd;
-
+
fd = js_new_function_def(s->ctx, s->cur_func, FALSE, FALSE,
s->filename, 0);
if (!fd)
@@ -33562,7 +33562,7 @@ static JSFunctionDef *js_parse_function_class_fields_init(JSParseState *s)
fd->func_name = JS_ATOM_NULL;
fd->has_prototype = FALSE;
fd->has_home_object = TRUE;
-
+
fd->has_arguments_binding = FALSE;
fd->has_this_binding = TRUE;
fd->is_derived_class_constructor = FALSE;
@@ -33570,7 +33570,7 @@ static JSFunctionDef *js_parse_function_class_fields_init(JSParseState *s)
fd->super_call_allowed = FALSE;
fd->super_allowed = fd->has_home_object;
fd->arguments_allowed = FALSE;
-
+
fd->func_kind = JS_FUNC_NORMAL;
fd->func_type = JS_PARSE_FUNC_METHOD;
return fd;
@@ -33753,7 +33753,7 @@ static __exception int js_parse_function_decl2(JSParseState *s,
if (func_type == JS_PARSE_FUNC_CLASS_CONSTRUCTOR) {
emit_class_field_init(s);
}
-
+
/* parse arguments */
fd->has_simple_parameter_list = TRUE;
fd->has_parameter_expressions = FALSE;
@@ -33788,7 +33788,7 @@ static __exception int js_parse_function_decl2(JSParseState *s,
if (push_scope(s) < 0)
return -1;
}
-
+
while (s->token.val != ')') {
JSAtom name;
BOOL rest = FALSE;
@@ -33853,7 +33853,7 @@ static __exception int js_parse_function_decl2(JSParseState *s,
has_opt_arg = TRUE;
} else if (s->token.val == '=') {
int label;
-
+
fd->has_simple_parameter_list = FALSE;
has_opt_arg = TRUE;
@@ -33936,7 +33936,7 @@ static __exception int js_parse_function_decl2(JSParseState *s,
}
idx = vd->scope_next;
}
-
+
/* the argument scope has no parent, hence we don't use pop_scope(s) */
emit_op(s, OP_leave_scope);
emit_u16(s, fd->scope_level);
@@ -33945,7 +33945,7 @@ static __exception int js_parse_function_decl2(JSParseState *s,
fd->scope_level = 0;
fd->scope_first = fd->scopes[fd->scope_level].first;
}
-
+
if (next_token(s))
goto fail;
@@ -34030,7 +34030,7 @@ static __exception int js_parse_function_decl2(JSParseState *s,
by just using next_token() here for normal functions, but it is
necessary for arrow functions with an expression body. */
reparse_ident_token(s);
-
+
/* create the function object */
{
int idx;
@@ -34067,7 +34067,7 @@ static __exception int js_parse_function_decl2(JSParseState *s,
/* it is considered as defined at the top level
(needed for annex B.3.3.4 and B.3.3.5
checks) */
- hf->scope_level = 0;
+ hf->scope_level = 0;
hf->force_init = ((s->cur_func->js_mode & JS_MODE_STRICT) != 0);
/* store directly into global var, bypass lexical scope */
emit_op(s, OP_dup);
@@ -34338,7 +34338,7 @@ static JSValue __JS_EvalInternal(JSContext *ctx, JSValueConst this_obj,
push_scope(s); /* body scope */
fd->body_scope = fd->scope_level;
-
+
err = js_parse_program(s);
if (err) {
fail:
@@ -34476,13 +34476,13 @@ static int js_object_list_resize_hash(JSContext *ctx, JSObjectList *s,
js_free(ctx, s->hash_table);
s->hash_table = new_hash_table;
s->hash_size = new_hash_size;
-
+
for(i = 0; i < s->hash_size; i++) {
s->hash_table[i] = -1;
}
for(i = 0; i < s->object_count; i++) {
e = &s->object_tab[i];
- h = js_object_list_get_hash(e->obj, s->hash_size);
+ h = js_object_list_get_hash(e->obj, s->hash_size);
e->hash_next = s->hash_table[h];
s->hash_table[h] = i;
}
@@ -34495,7 +34495,7 @@ static int js_object_list_add(JSContext *ctx, JSObjectList *s, JSObject *obj)
{
JSObjectListEntry *e;
uint32_t h, new_hash_size;
-
+
if (js_resize_array(ctx, (void *)&s->object_tab,
sizeof(s->object_tab[0]),
&s->object_size, s->object_count + 1))
@@ -34508,7 +34508,7 @@ static int js_object_list_add(JSContext *ctx, JSObjectList *s, JSObject *obj)
return -1;
}
e = &s->object_tab[s->object_count++];
- h = js_object_list_get_hash(obj, s->hash_size);
+ h = js_object_list_get_hash(obj, s->hash_size);
e->obj = obj;
e->hash_next = s->hash_table[h];
s->hash_table[h] = s->object_count - 1;
@@ -34524,7 +34524,7 @@ static int js_object_list_find(JSContext *ctx, JSObjectList *s, JSObject *obj)
/* must test empty size because there is no hash table */
if (s->object_count == 0)
return -1;
- h = js_object_list_get_hash(obj, s->hash_size);
+ h = js_object_list_get_hash(obj, s->hash_size);
p = s->hash_table[h];
while (p != -1) {
e = &s->object_tab[p];
@@ -34863,7 +34863,7 @@ static int JS_WriteBigNum(BCWriterState *s, JSValueConst obj)
case JS_TAG_BIG_DECIMAL:
tag1 = BC_TAG_BIG_DECIMAL;
break;
-#endif
+#endif
default:
abort();
}
@@ -34929,7 +34929,7 @@ static int JS_WriteBigNum(BCWriterState *s, JSValueConst obj)
int bpos, d;
uint8_t v8;
size_t i0;
-
+
/* little endian BCD */
i = 0;
while (i < a->len && a->tab[i] == 0)
@@ -34949,7 +34949,7 @@ static int JS_WriteBigNum(BCWriterState *s, JSValueConst obj)
return -1;
}
bc_put_leb128(s, len);
-
+
bpos = 0;
v8 = 0;
i0 = i;
@@ -34986,7 +34986,7 @@ static int JS_WriteFunctionTag(BCWriterState *s, JSValueConst obj)
JSFunctionBytecode *b = JS_VALUE_GET_PTR(obj);
uint32_t flags;
int idx, i;
-
+
bc_put_u8(s, BC_TAG_FUNCTION_BYTECODE);
flags = idx = 0;
bc_set_flags(&flags, &idx, b->has_prototype, 1);
@@ -35005,7 +35005,7 @@ static int JS_WriteFunctionTag(BCWriterState *s, JSValueConst obj)
bc_put_u16(s, flags);
bc_put_u8(s, b->js_mode);
bc_put_atom(s, b->func_name);
-
+
bc_put_leb128(s, b->arg_count);
bc_put_leb128(s, b->var_count);
bc_put_leb128(s, b->defined_arg_count);
@@ -35032,7 +35032,7 @@ static int JS_WriteFunctionTag(BCWriterState *s, JSValueConst obj)
} else {
bc_put_leb128(s, 0);
}
-
+
for(i = 0; i < b->closure_var_count; i++) {
JSClosureVar *cv = &b->closure_var[i];
bc_put_atom(s, cv->var_name);
@@ -35046,17 +35046,17 @@ static int JS_WriteFunctionTag(BCWriterState *s, JSValueConst obj)
assert(idx <= 8);
bc_put_u8(s, flags);
}
-
+
if (JS_WriteFunctionBytecode(s, b->byte_code_buf, b->byte_code_len))
goto fail;
-
+
if (b->has_debug) {
bc_put_atom(s, b->debug.filename);
bc_put_leb128(s, b->debug.line_num);
bc_put_leb128(s, b->debug.pc2line_len);
dbuf_put(&s->dbuf, b->debug.pc2line_buf, b->debug.pc2line_len);
}
-
+
for(i = 0; i < b->cpool_count; i++) {
if (JS_WriteObjectRec(s, b->cpool[i]))
goto fail;
@@ -35070,16 +35070,16 @@ static int JS_WriteModule(BCWriterState *s, JSValueConst obj)
{
JSModuleDef *m = JS_VALUE_GET_PTR(obj);
int i;
-
+
bc_put_u8(s, BC_TAG_MODULE);
bc_put_atom(s, m->module_name);
-
+
bc_put_leb128(s, m->req_module_entries_count);
for(i = 0; i < m->req_module_entries_count; i++) {
JSReqModuleEntry *rme = &m->req_module_entries[i];
bc_put_atom(s, rme->module_name);
}
-
+
bc_put_leb128(s, m->export_entries_count);
for(i = 0; i < m->export_entries_count; i++) {
JSExportEntry *me = &m->export_entries[i];
@@ -35092,13 +35092,13 @@ static int JS_WriteModule(BCWriterState *s, JSValueConst obj)
}
bc_put_atom(s, me->export_name);
}
-
+
bc_put_leb128(s, m->star_export_entries_count);
for(i = 0; i < m->star_export_entries_count; i++) {
JSStarExportEntry *se = &m->star_export_entries[i];
bc_put_leb128(s, se->req_module_idx);
}
-
+
bc_put_leb128(s, m->import_entries_count);
for(i = 0; i < m->import_entries_count; i++) {
JSImportEntry *mi = &m->import_entries[i];
@@ -35108,7 +35108,7 @@ static int JS_WriteModule(BCWriterState *s, JSValueConst obj)
}
bc_put_u8(s, m->has_tla);
-
+
if (JS_WriteObjectRec(s, m->func_obj))
goto fail;
return 0;
@@ -35123,7 +35123,7 @@ static int JS_WriteArray(BCWriterState *s, JSValueConst obj)
JSValue val;
int ret;
BOOL is_template;
-
+
if (s->allow_bytecode && !p->extensible) {
/* not extensible array: we consider it is a
template when we are saving bytecode */
@@ -35297,7 +35297,7 @@ static int JS_WriteObjectRec(BCWriterState *s, JSValueConst obj)
{
JSObject *p = JS_VALUE_GET_OBJ(obj);
int ret, idx;
-
+
if (s->allow_reference) {
idx = js_object_list_find(s->ctx, &s->object_list, p);
if (idx >= 0) {
@@ -35438,7 +35438,7 @@ uint8_t *JS_WriteObject2(JSContext *ctx, size_t *psize, JSValueConst obj,
s->first_atom = 1;
js_dbuf_init(ctx, &s->dbuf);
js_object_list_init(&s->object_list);
-
+
if (JS_WriteObjectRec(s, obj))
goto fail;
if (JS_WriteObjectAtoms(s))
@@ -35486,7 +35486,7 @@ typedef struct BCReaderState {
JSObject **objects;
int objects_count;
int objects_size;
-
+
#ifdef DUMP_READ_OBJECT
const uint8_t *ptr_last;
int level;
@@ -35770,7 +35770,7 @@ static JSValue JS_ReadBigNum(BCReaderState *s, int tag)
limb_t v;
bf_t *a;
int bpos, d;
-
+
p = js_new_bf(s->ctx);
if (!p)
goto fail;
@@ -35785,7 +35785,7 @@ static JSValue JS_ReadBigNum(BCReaderState *s, int tag)
case BC_TAG_BIG_DECIMAL:
obj = JS_MKPTR(JS_TAG_BIG_DECIMAL, p);
break;
-#endif
+#endif
default:
abort();
}
@@ -35984,7 +35984,7 @@ static JSValue JS_ReadFunctionTag(BCReaderState *s)
b = js_mallocz(ctx, function_size);
if (!b)
return JS_EXCEPTION;
-
+
memcpy(b, &bc, offsetof(JSFunctionBytecode, debug));
b->header.ref_count = 1;
if (local_count != 0) {
@@ -35996,9 +35996,9 @@ static JSValue JS_ReadFunctionTag(BCReaderState *s)
if (b->cpool_count != 0) {
b->cpool = (void *)((uint8_t*)b + cpool_offset);
}
-
+
add_gc_object(ctx->rt, &b->header, JS_GC_OBJ_TYPE_FUNCTION_BYTECODE);
-
+
obj = JS_MKPTR(JS_TAG_FUNCTION_BYTECODE, b);
#ifdef DUMP_READ_OBJECT
@@ -36111,7 +36111,7 @@ static JSValue JS_ReadModule(BCReaderState *s)
JSAtom module_name;
int i;
uint8_t v8;
-
+
if (bc_get_atom(s, &module_name))
goto fail;
#ifdef DUMP_READ_OBJECT
@@ -36216,7 +36216,7 @@ static JSValue JS_ReadObjectTag(BCReaderState *s)
JSAtom atom;
JSValue val;
int ret;
-
+
obj = JS_NewObject(ctx);
if (BC_add_object_ref(s, obj))
goto fail;
@@ -36296,7 +36296,7 @@ static JSValue JS_ReadTypedArray(BCReaderState *s)
uint8_t array_tag;
JSValueConst args[3];
uint32_t offset, len, idx;
-
+
if (bc_get_u8(s, &array_tag))
return JS_EXCEPTION;
if (array_tag >= JS_TYPED_ARRAY_COUNT)
@@ -36341,7 +36341,7 @@ static JSValue JS_ReadArrayBuffer(BCReaderState *s)
JSContext *ctx = s->ctx;
uint32_t byte_length;
JSValue obj;
-
+
if (bc_get_leb128(s, &byte_length))
return JS_EXCEPTION;
if (unlikely(s->buf_end - s->ptr < byte_length)) {
@@ -36367,7 +36367,7 @@ static JSValue JS_ReadSharedArrayBuffer(BCReaderState *s)
uint8_t *data_ptr;
JSValue obj;
uint64_t u64;
-
+
if (bc_get_leb128(s, &byte_length))
return JS_EXCEPTION;
if (bc_get_u64(s, &u64))
@@ -36877,7 +36877,7 @@ static void JS_SetConstructor2(JSContext *ctx,
set_cycle_flag(ctx, proto);
}
-void JS_SetConstructor(JSContext *ctx, JSValueConst func_obj,
+void JS_SetConstructor(JSContext *ctx, JSValueConst func_obj,
JSValueConst proto)
{
JS_SetConstructor2(ctx, func_obj, proto,
@@ -37720,7 +37720,7 @@ static JSValue js_object_seal(JSContext *ctx, JSValueConst this_val,
if (!res) {
return JS_ThrowTypeError(ctx, "proxy preventExtensions handler returned false");
}
-
+
p = JS_VALUE_GET_OBJ(obj);
flags = JS_GPN_STRING_MASK | JS_GPN_SYMBOL_MASK;
if (JS_GetOwnPropertyNamesInternal(ctx, &props, &len, p, flags))
@@ -37761,7 +37761,7 @@ static JSValue js_object_isSealed(JSContext *ctx, JSValueConst this_val,
JSPropertyEnum *props;
uint32_t len, i;
int flags, res;
-
+
if (!JS_IsObject(obj))
return JS_TRUE;
@@ -37790,7 +37790,7 @@ static JSValue js_object_isSealed(JSContext *ctx, JSValueConst this_val,
if (res < 0)
return JS_EXCEPTION;
res ^= 1;
-done:
+done:
js_free_prop_enum(ctx, props, len);
return JS_NewBool(ctx, res);
@@ -37813,14 +37813,14 @@ static JSValue js_object_fromEntries(JSContext *ctx, JSValueConst this_val,
obj = JS_NewObject(ctx);
if (JS_IsException(obj))
return obj;
-
+
iter = JS_GetIterator(ctx, iterable, FALSE);
if (JS_IsException(iter))
goto fail;
next_method = JS_GetProperty(ctx, iter, JS_ATOM_next);
if (JS_IsException(next_method))
goto fail;
-
+
for(;;) {
JSValue key, value, item;
item = JS_IteratorNext(ctx, iter, next_method, 0, NULL, &done);
@@ -37830,7 +37830,7 @@ static JSValue js_object_fromEntries(JSContext *ctx, JSValueConst this_val,
JS_FreeValue(ctx, item);
break;
}
-
+
key = JS_UNDEFINED;
value = JS_UNDEFINED;
if (!JS_IsObject(item)) {
@@ -38216,7 +38216,7 @@ static JSValue js_function_constructor(JSContext *ctx, JSValueConst new_target,
string_buffer_init(ctx, b, 0);
string_buffer_putc8(b, '(');
-
+
if (func_kind == JS_FUNC_ASYNC || func_kind == JS_FUNC_ASYNC_GENERATOR) {
string_buffer_puts8(b, "async ");
}
@@ -38549,7 +38549,7 @@ static JSValue iterator_to_array(JSContext *ctx, JSValueConst items)
JSValue v, r = JS_UNDEFINED;
int64_t k;
BOOL done;
-
+
iter = JS_GetIterator(ctx, items, FALSE);
if (JS_IsException(iter))
goto exception;
@@ -38596,7 +38596,7 @@ static JSValue js_error_constructor(JSContext *ctx, JSValueConst new_target,
if (!JS_IsObject(proto)) {
JSContext *realm;
JSValueConst proto1;
-
+
JS_FreeValue(ctx, proto);
realm = JS_GetFunctionRealm(ctx, new_target);
if (!realm)
@@ -38697,7 +38697,7 @@ static JSValue js_aggregate_error_constructor(JSContext *ctx,
JSValueConst errors)
{
JSValue obj;
-
+
obj = JS_NewObjectProtoClass(ctx,
ctx->native_error_proto[JS_AGGREGATE_ERROR],
JS_CLASS_ERROR);
@@ -38763,7 +38763,7 @@ static int JS_CopySubArray(JSContext *ctx,
fromPresent = JS_TryGetPropertyInt64(ctx, obj, from, &val);
if (fromPresent < 0)
goto exception;
-
+
if (fromPresent) {
if (JS_SetPropertyInt64(ctx, obj, to, val) < 0)
goto exception;
@@ -38971,7 +38971,7 @@ static JSValue JS_ArraySpeciesCreate(JSContext *ctx, JSValueConst obj,
JSValue ctor, ret, species;
int res;
JSContext *realm;
-
+
res = JS_IsArray(ctx, obj);
if (res < 0)
return JS_EXCEPTION;
@@ -39039,7 +39039,7 @@ static JSValue js_array_at(JSContext *ctx, JSValueConst this_val,
int64_t len, idx;
JSValue *arrp;
uint32_t count;
-
+
obj = JS_ToObject(ctx, this_val);
if (js_get_length64(ctx, &len, obj))
goto exception;
@@ -39236,7 +39236,7 @@ static JSValue js_array_every(JSContext *ctx, JSValueConst this_val,
this_arg = JS_UNDEFINED;
if (argc > 1)
this_arg = argv[1];
-
+
if (check_function(ctx, func))
goto exception;
@@ -40777,7 +40777,7 @@ static JSValue js_number_constructor(JSContext *ctx, JSValueConst new_target,
case JS_TAG_BIG_INT:
#ifdef CONFIG_BIGNUM
case JS_TAG_BIG_FLOAT:
-#endif
+#endif
{
JSBigFloat *p = JS_VALUE_GET_PTR(val);
double d;
@@ -41166,7 +41166,7 @@ static int js_string_define_own_property(JSContext *ctx,
uint32_t idx;
JSObject *p;
JSString *p1, *p2;
-
+
if (__JS_AtomIsTaggedInt(prop)) {
idx = __JS_AtomToUInt32(prop);
p = JS_VALUE_GET_OBJ(this_obj);
@@ -41332,7 +41332,7 @@ static JSValue js_string_raw(JSContext *ctx, JSValueConst this_val,
goto exception;
if (js_get_length64(ctx, &n, raw) < 0)
goto exception;
-
+
for (i = 0; i < n; i++) {
val = JS_ToStringFree(ctx, JS_GetPropertyInt64(ctx, raw, i));
if (JS_IsException(val))
@@ -41581,7 +41581,7 @@ static JSValue js_string_isWellFormed(JSContext *ctx, JSValueConst this_val,
JSValue str;
JSString *p;
BOOL ret;
-
+
str = JS_ToStringCheckObject(ctx, this_val);
if (JS_IsException(str))
return JS_EXCEPTION;
@@ -41612,7 +41612,7 @@ static JSValue js_string_toWellFormed(JSContext *ctx, JSValueConst this_val,
JS_FreeValue(ctx, str);
if (JS_IsException(ret))
return JS_EXCEPTION;
-
+
p = JS_VALUE_GET_STRING(ret);
for (; i < p->len; i++) {
c = p->u.str16[i];
@@ -41768,7 +41768,7 @@ static int check_regexp_g_flag(JSContext *ctx, JSValueConst regexp)
{
int ret;
JSValue flags;
-
+
ret = js_is_regexp(ctx, regexp);
if (ret < 0)
return -1;
@@ -42042,7 +42042,7 @@ static JSValue js_string_replace(JSContext *ctx, JSValueConst this_val,
}
if (JS_IsException(repl_str))
goto exception;
-
+
string_buffer_concat(b, sp, endOfLastMatch, pos);
string_buffer_concat_value_free(b, repl_str);
endOfLastMatch = pos + searchp->len;
@@ -42529,13 +42529,13 @@ static JSValue JS_NewUTF32String(JSContext *ctx, const uint32_t *buf, int len)
return JS_EXCEPTION;
}
-static int js_string_normalize1(JSContext *ctx, uint32_t **pout_buf,
+static int js_string_normalize1(JSContext *ctx, uint32_t **pout_buf,
JSValueConst val,
UnicodeNormalizationEnum n_type)
{
int buf_len, out_len;
uint32_t *buf, *out_buf;
-
+
buf_len = JS_ToUTF32String(ctx, &buf, val);
if (buf_len < 0)
return -1;
@@ -42628,7 +42628,7 @@ static JSValue js_string_localeCompare(JSContext *ctx, JSValueConst this_val,
JSValue a, b;
int cmp, a_len, b_len;
uint32_t *a_buf, *b_buf;
-
+
a = JS_ToStringCheckObject(ctx, this_val);
if (JS_IsException(a))
return JS_EXCEPTION;
@@ -42789,7 +42789,7 @@ static JSValue js_string_CreateHTML(JSContext *ctx, JSValueConst this_val,
static struct { const char *tag, *attr; } const defs[] = {
{ "a", "name" }, { "big", NULL }, { "blink", NULL }, { "b", NULL },
{ "tt", NULL }, { "font", "color" }, { "font", "size" }, { "i", NULL },
- { "a", "href" }, { "small", NULL }, { "strike", NULL },
+ { "a", "href" }, { "small", NULL }, { "strike", NULL },
{ "sub", NULL }, { "sup", NULL },
};
@@ -43192,7 +43192,7 @@ static int getTimezoneOffset(int64_t time)
{
time_t ti;
int res;
-
+
time /= 1000; /* convert to seconds */
if (sizeof(time_t) == 4) {
/* on 32-bit systems, we need to clamp the time value to the
@@ -43219,10 +43219,10 @@ static int getTimezoneOffset(int64_t time)
{
struct tm *tm;
time_t gm_ti, loc_ti;
-
+
tm = gmtime(&ti);
gm_ti = mktime(tm);
-
+
tm = localtime(&ti);
loc_ti = mktime(tm);
@@ -43586,7 +43586,7 @@ static JSValue js_regexp_get_source(JSContext *ctx, JSValueConst this_val)
if (p->len == 0) {
empty_regex:
return JS_NewString(ctx, "(?:)");
- }
+ }
string_buffer_init2(ctx, b, p->len, p->is_wide_char);
/* Escape '/' and newline sequences as needed */
@@ -43645,7 +43645,7 @@ static JSValue js_regexp_get_flag(JSContext *ctx, JSValueConst this_val, int mas
else
return JS_ThrowTypeErrorInvalidClass(ctx, JS_CLASS_REGEXP);
}
-
+
flags = lre_get_flags(re->bytecode->u.str8);
return JS_NewBool(ctx, (flags & mask) != 0);
}
@@ -43834,7 +43834,7 @@ static JSValue js_regexp_exec(JSContext *ctx, JSValueConst this_val,
int start = -1;
int end = -1;
JSValue val;
-
+
if (group_name_ptr && i > 0) {
if (*group_name_ptr) name = group_name_ptr;
group_name_ptr += strlen(group_name_ptr) + 1;
@@ -44260,7 +44260,7 @@ static JSValue js_regexp_Symbol_matchAll(JSContext *ctx, JSValueConst this_val,
JSString *strp;
int64_t lastIndex;
JSRegExpStringIteratorData *it;
-
+
if (!JS_IsObject(R))
return JS_ThrowTypeErrorNotAnObject(ctx);
@@ -44268,7 +44268,7 @@ static JSValue js_regexp_Symbol_matchAll(JSContext *ctx, JSValueConst this_val,
flags = JS_UNDEFINED;
matcher = JS_UNDEFINED;
iter = JS_UNDEFINED;
-
+
S = JS_ToString(ctx, argv[0]);
if (JS_IsException(S))
goto exception;
@@ -44289,7 +44289,7 @@ static JSValue js_regexp_Symbol_matchAll(JSContext *ctx, JSValueConst this_val,
if (JS_SetProperty(ctx, matcher, JS_ATOM_lastIndex,
JS_NewInt64(ctx, lastIndex)) < 0)
goto exception;
-
+
iter = JS_NewObjectClass(ctx, JS_CLASS_REGEXP_STRING_ITERATOR);
if (JS_IsException(iter))
goto exception;
@@ -44428,7 +44428,7 @@ static JSValue js_regexp_Symbol_replace(JSContext *ctx, JSValueConst this_val,
str = JS_ToString(ctx, argv[0]);
if (JS_IsException(str))
goto exception;
-
+
sp = JS_VALUE_GET_STRING(str);
rp = NULL;
functionalReplace = JS_IsFunction(ctx, rep);
@@ -44716,7 +44716,7 @@ static JSValue js_regexp_Symbol_split(JSContext *ctx, JSValueConst this_val,
while (q < size) {
if (JS_SetProperty(ctx, splitter, JS_ATOM_lastIndex, JS_NewInt32(ctx, q)) < 0)
goto exception;
- JS_FreeValue(ctx, z);
+ JS_FreeValue(ctx, z);
z = JS_RegExpExec(ctx, splitter, str);
if (JS_IsException(z))
goto exception;
@@ -44771,7 +44771,7 @@ done:
JS_FreeValue(ctx, ctor);
JS_FreeValue(ctx, splitter);
JS_FreeValue(ctx, flags);
- JS_FreeValue(ctx, z);
+ JS_FreeValue(ctx, z);
return A;
}
@@ -44857,7 +44857,7 @@ static JSValue json_parse_value(JSParseState *s)
{
JSValue prop_val;
JSAtom prop_name;
-
+
if (json_next_token(s))
goto fail;
val = JS_NewObject(ctx);
@@ -45000,7 +45000,7 @@ JSValue JS_ParseJSON2(JSContext *ctx, const char *buf, size_t buf_len,
JSValue JS_ParseJSON(JSContext *ctx, const char *buf, size_t buf_len,
const char *filename)
{
- return JS_ParseJSON2(ctx, buf, buf_len, filename, 0);
+ return JS_ParseJSON2(ctx, buf, buf_len, filename, 0);
}
static JSValue internalize_json_property(JSContext *ctx, JSValueConst holder,
@@ -45189,7 +45189,7 @@ static int js_json_to_str(JSContext *ctx, JSONStringifyContext *jsc,
int64_t i, len;
int cl, ret;
BOOL has_content;
-
+
indent1 = JS_UNDEFINED;
sep = JS_UNDEFINED;
sep1 = JS_UNDEFINED;
@@ -45363,7 +45363,7 @@ static int js_json_to_str(JSContext *ctx, JSONStringifyContext *jsc,
JS_FreeValue(ctx, val);
return 0;
}
-
+
exception:
JS_FreeValue(ctx, val);
JS_FreeValue(ctx, tab);
@@ -45481,7 +45481,7 @@ JSValue JS_JSONStringify(JSContext *ctx, JSValueConst obj,
JS_DupValue(ctx, obj), JS_PROP_C_W_E) < 0)
goto exception;
val = JS_DupValue(ctx, obj);
-
+
val = js_json_check(ctx, jsc, wrapper, val, jsc->empty);
if (JS_IsException(val))
goto exception;
@@ -45737,7 +45737,7 @@ static JSProxyData *get_proxy_method(JSContext *ctx, JSValue *pmethod,
JS_ThrowStackOverflow(ctx);
return NULL;
}
-
+
/* 's' should never be NULL */
if (s->is_revoked) {
JS_ThrowTypeErrorRevokedProxy(ctx);
@@ -46136,7 +46136,7 @@ static int js_proxy_get_own_property(JSContext *ctx, JSPropertyDescriptor *pdesc
JS_FreeValue(ctx, trap_result_obj);
if (res < 0)
return -1;
-
+
if (target_desc_ret) {
/* convert result_desc.flags to defineProperty flags */
flags1 = result_desc.flags | JS_PROP_HAS_CONFIGURABLE | JS_PROP_HAS_ENUMERABLE;
@@ -46501,7 +46501,7 @@ static JSValue js_proxy_call(JSContext *ctx, JSValueConst func_obj,
if (flags & JS_CALL_FLAG_CONSTRUCTOR)
return js_proxy_call_constructor(ctx, func_obj, this_obj, argc, argv);
-
+
s = get_proxy_method(ctx, &method, func_obj, JS_ATOM_apply);
if (!s)
return JS_EXCEPTION;
@@ -47090,7 +47090,7 @@ static void reset_weak_ref(JSRuntime *rt, JSObject *p)
{
JSMapRecord *mr, *mr_next;
JSMapState *s;
-
+
/* first pass to remove the records from the WeakMap/WeakSet
lists */
for(mr = p->first_weak_ref; mr != NULL; mr = mr->next_weak_ref) {
@@ -47100,7 +47100,7 @@ static void reset_weak_ref(JSRuntime *rt, JSObject *p)
list_del(&mr->hash_link);
list_del(&mr->link);
}
-
+
/* second pass to free the values to avoid modifying the weak
reference list while traversing it. */
for(mr = p->first_weak_ref; mr != NULL; mr = mr_next) {
@@ -47283,7 +47283,7 @@ static JSValue js_object_groupBy(JSContext *ctx, JSValueConst this_val,
v = JS_UNDEFINED;
prop = JS_UNDEFINED;
groups = JS_UNDEFINED;
-
+
next = JS_GetProperty(ctx, iter, JS_ATOM_next);
if (JS_IsException(next))
goto exception;
@@ -48223,7 +48223,7 @@ static JSValue js_promise_all_resolve_element(JSContext *ctx,
JSValueConst resolve_element_env = func_data[4];
JSValue ret, obj;
int is_zero, index;
-
+
if (JS_ToInt32(ctx, &index, func_data[1]))
return JS_EXCEPTION;
if (alreadyCalled)
@@ -48232,7 +48232,7 @@ static JSValue js_promise_all_resolve_element(JSContext *ctx,
if (resolve_type == PROMISE_MAGIC_allSettled) {
JSValue str;
-
+
obj = JS_NewObject(ctx);
if (JS_IsException(obj))
return JS_EXCEPTION;
@@ -48257,7 +48257,7 @@ static JSValue js_promise_all_resolve_element(JSContext *ctx,
if (JS_DefinePropertyValueUint32(ctx, values, index,
obj, JS_PROP_C_W_E) < 0)
return JS_EXCEPTION;
-
+
is_zero = remainingElementsCount_add(ctx, resolve_element_env, -1);
if (is_zero < 0)
return JS_EXCEPTION;
@@ -48290,7 +48290,7 @@ static JSValue js_promise_all(JSContext *ctx, JSValueConst this_val,
JSValueConst then_args[2], resolve_element_data[5];
BOOL done;
int index, is_zero, is_promise_any = (magic == PROMISE_MAGIC_any);
-
+
if (!JS_IsObject(this_val))
return JS_ThrowTypeErrorNotAnObject(ctx);
result_promise = js_new_promise_capability(ctx, resolving_funcs, this_val);
@@ -48326,7 +48326,7 @@ static JSValue js_promise_all(JSContext *ctx, JSValueConst this_val,
JS_NewInt32(ctx, 1),
JS_PROP_CONFIGURABLE | JS_PROP_ENUMERABLE | JS_PROP_WRITABLE) < 0)
goto fail_reject;
-
+
index = 0;
for(;;) {
/* XXX: conformance: should close the iterator if error on 'done'
@@ -48336,7 +48336,7 @@ static JSValue js_promise_all(JSContext *ctx, JSValueConst this_val,
goto fail_reject;
if (done)
break;
- next_promise = JS_Call(ctx, promise_resolve,
+ next_promise = JS_Call(ctx, promise_resolve,
this_val, 1, (JSValueConst *)&item);
JS_FreeValue(ctx, item);
if (JS_IsException(next_promise)) {
@@ -48356,7 +48356,7 @@ static JSValue js_promise_all(JSContext *ctx, JSValueConst this_val,
JS_FreeValue(ctx, next_promise);
goto fail_reject1;
}
-
+
if (magic == PROMISE_MAGIC_allSettled) {
reject_element =
JS_NewCFunctionData(ctx, js_promise_all_resolve_element, 1,
@@ -49430,7 +49430,7 @@ static double set_date_fields(double fields[], int is_local) {
int64_t y;
double days, d, h, m1;
int i, m, md;
-
+
m1 = fields[1];
m = fmod(m1, 12);
if (m < 0)
@@ -49445,7 +49445,7 @@ static double set_date_fields(double fields[], int is_local) {
days += md;
}
days += fields[2] - 1;
- h = fields[3] * 3600000 + fields[4] * 60000 +
+ h = fields[3] * 3600000 + fields[4] * 60000 +
fields[5] * 1000 + fields[6];
d = days * 86400000 + h;
if (is_local)
@@ -49742,7 +49742,7 @@ static void string_skip_non_spaces(JSString *sp, int *pp) {
static int string_get_digits(JSString *sp, int *pp, int64_t *pval) {
int64_t v = 0;
int c, p = *pp, p_start;
-
+
if (p >= sp->len)
return -1;
p_start = p;
@@ -49764,14 +49764,14 @@ static int string_get_digits(JSString *sp, int *pp, int64_t *pval) {
static int string_get_signed_digits(JSString *sp, int *pp, int64_t *pval) {
int res, sgn, p = *pp;
-
+
if (p >= sp->len)
return -1;
sgn = string_get(sp, p);
if (sgn == '-' || sgn == '+')
p++;
-
+
res = string_get_digits(sp, &p, pval);
if (res == 0 && sgn == '-') {
if (*pval == 0)
@@ -49868,13 +49868,13 @@ static JSValue js_Date_parse(JSContext *ctx, JSValueConst this_val,
int p, i, c, sgn, l;
JSString *sp;
BOOL is_local;
-
+
rv = JS_NAN;
s = JS_ToString(ctx, argv[0]);
if (JS_IsException(s))
return JS_EXCEPTION;
-
+
sp = JS_VALUE_GET_STRING(s);
p = 0;
if (p < sp->len && (((c = string_get(sp, p)) >= '0' && c <= '9') || c == '+' || c == '-')) {
@@ -50238,7 +50238,7 @@ static void js_operator_set_finalizer(JSRuntime *rt, JSValue val)
JSOperatorSetData *opset = JS_GetOpaque(val, JS_CLASS_OPERATOR_SET);
int i, j;
JSBinaryOperatorDefEntry *ent;
-
+
if (opset) {
for(i = 0; i < JS_OVOP_COUNT; i++) {
if (opset->self_ops[i])
@@ -50270,7 +50270,7 @@ static void js_operator_set_mark(JSRuntime *rt, JSValueConst val,
JSOperatorSetData *opset = JS_GetOpaque(val, JS_CLASS_OPERATOR_SET);
int i, j;
JSBinaryOperatorDefEntry *ent;
-
+
if (opset) {
for(i = 0; i < JS_OVOP_COUNT; i++) {
if (opset->self_ops[i])
@@ -50370,7 +50370,7 @@ static JSValue js_operators_create_internal(JSContext *ctx,
}
op_count = opset1->operator_counter;
JS_FreeValue(ctx, prop);
-
+
/* we assume there are few entries */
new_tab = js_realloc(ctx, def->tab,
(def->count + 1) * sizeof(def->tab[0]));
@@ -50381,7 +50381,7 @@ static JSValue js_operators_create_internal(JSContext *ctx,
ent = def->tab + def->count - 1;
memset(ent, 0, sizeof(def->tab[0]));
ent->operator_index = op_count;
-
+
for(i = 0; i < JS_OVOP_BINARY_COUNT; i++) {
prop = JS_GetPropertyStr(ctx, arg,
js_overloadable_operator_names[i]);
@@ -50418,7 +50418,7 @@ static JSValue js_operators_updateBigIntOperators(JSContext *ctx, JSValueConst t
const JSOverloadableOperatorEnum ops[2] = { JS_OVOP_DIV, JS_OVOP_POW };
JSOverloadableOperatorEnum op;
int i;
-
+
opset_obj = JS_GetProperty(ctx, ctx->class_proto[JS_CLASS_BIG_INT],
JS_ATOM_Symbol_operatorSet);
if (JS_IsException(opset_obj))
@@ -50548,10 +50548,10 @@ static JSValue JS_ToBigIntCtorFree(JSContext *ctx, JSValue val)
case JS_TAG_FLOAT64:
#ifdef CONFIG_BIGNUM
case JS_TAG_BIG_FLOAT:
-#endif
+#endif
{
bf_t *a, a_s;
-
+
a = JS_ToBigFloat(ctx, &a_s, val);
if (!a) {
JS_FreeValue(ctx, val);
@@ -50592,7 +50592,7 @@ static JSValue JS_ToBigIntCtorFree(JSContext *ctx, JSValue val)
if (JS_IsException(val))
break;
goto redo;
-#endif
+#endif
case JS_TAG_STRING:
val = JS_StringToBigIntErr(ctx, val);
break;
@@ -50673,7 +50673,7 @@ static JSValue js_bigint_div(JSContext *ctx,
bf_t a_s, b_s, *a, *b, *r, *q;
int status;
JSValue q_val, r_val;
-
+
q_val = JS_NewBigInt(ctx);
if (JS_IsException(q_val))
return JS_EXCEPTION;
@@ -50724,7 +50724,7 @@ static JSValue js_bigint_sqrt(JSContext *ctx,
bf_t a_s, *a, *r, *rem;
int status;
JSValue r_val, rem_val;
-
+
r_val = JS_NewBigInt(ctx);
if (JS_IsException(r_val))
return JS_EXCEPTION;
@@ -50803,7 +50803,7 @@ static JSValue js_bigint_asUintN(JSContext *ctx,
uint64_t bits;
bf_t a_s, *a = &a_s, *r, mask_s, *mask = &mask_s;
JSValue res;
-
+
if (JS_ToIndex(ctx, &bits, argv[0]))
return JS_EXCEPTION;
res = JS_NewBigInt(ctx);
@@ -50853,7 +50853,7 @@ static const JSCFunctionListEntry js_bigint_funcs[] = {
JS_CFUNC_MAGIC_DEF("sqrtrem", 1, js_bigint_sqrt, 1 ),
JS_CFUNC_MAGIC_DEF("floorLog2", 1, js_bigint_op1, 0 ),
JS_CFUNC_MAGIC_DEF("ctz", 1, js_bigint_op1, 1 ),
-#endif
+#endif
};
static const JSCFunctionListEntry js_bigint_proto_funcs[] = {
@@ -51299,7 +51299,7 @@ static JSValue js_bigfloat_isFinite(JSContext *ctx, JSValueConst this_val,
{
JSValueConst val = argv[0];
JSBigFloat *p;
-
+
if (JS_VALUE_GET_NORM_TAG(val) != JS_TAG_BIG_FLOAT)
return JS_FALSE;
p = JS_VALUE_GET_PTR(val);
@@ -51311,7 +51311,7 @@ static JSValue js_bigfloat_isNaN(JSContext *ctx, JSValueConst this_val,
{
JSValueConst val = argv[0];
JSBigFloat *p;
-
+
if (JS_VALUE_GET_NORM_TAG(val) != JS_TAG_BIG_FLOAT)
return JS_FALSE;
p = JS_VALUE_GET_PTR(val);
@@ -51775,7 +51775,7 @@ void JS_AddIntrinsicBigFloat(JSContext *ctx)
{
JSRuntime *rt = ctx->rt;
JSValueConst obj1;
-
+
rt->bigfloat_ops.to_string = js_bigfloat_to_string;
rt->bigfloat_ops.from_string = js_string_to_bigfloat;
rt->bigfloat_ops.unary_arith = js_unary_arith_bigfloat;
@@ -51783,7 +51783,7 @@ void JS_AddIntrinsicBigFloat(JSContext *ctx)
rt->bigfloat_ops.compare = js_compare_bigfloat;
rt->bigfloat_ops.mul_pow10_to_float64 = js_mul_pow10_to_float64;
rt->bigfloat_ops.mul_pow10 = js_mul_pow10;
-
+
ctx->class_proto[JS_CLASS_BIG_FLOAT] = JS_NewObject(ctx);
JS_SetPropertyFunctionList(ctx, ctx->class_proto[JS_CLASS_BIG_FLOAT],
js_bigfloat_proto_funcs,
@@ -51959,7 +51959,7 @@ static int js_bigdecimal_get_rnd_mode(JSContext *ctx, JSValueConst obj)
const char *str;
size_t size;
int rnd_mode;
-
+
str = JS_ToCStringLen(ctx, &size, obj);
if (!str)
return -1;
@@ -51999,7 +51999,7 @@ static int js_bigdecimal_get_env(JSContext *ctx, BigDecimalEnv *fe,
int64_t val;
BOOL has_prec;
int rnd_mode;
-
+
if (!JS_IsObject(obj)) {
JS_ThrowTypeErrorNotAnObject(ctx);
return -1;
@@ -52012,7 +52012,7 @@ static int js_bigdecimal_get_env(JSContext *ctx, BigDecimalEnv *fe,
if (rnd_mode < 0)
return -1;
fe->flags = rnd_mode;
-
+
prop = JS_GetProperty(ctx, obj, JS_ATOM_maximumSignificantDigits);
if (JS_IsException(prop))
return -1;
@@ -52067,7 +52067,7 @@ static JSValue js_bigdecimal_fop(JSContext *ctx, JSValueConst this_val,
op_count = 1;
else
op_count = 2;
-
+
op1 = JS_ToNumeric(ctx, argv[0]);
if (JS_IsException(op1))
return op1;
@@ -52698,7 +52698,7 @@ static void js_array_buffer_finalizer(JSRuntime *rt, JSValue val)
JSObject *p = JS_VALUE_GET_OBJ(val);
JSArrayBuffer *abuf = p->u.array_buffer;
struct list_head *el, *el1;
-
+
if (abuf) {
/* The ArrayBuffer finalizer may be called before the typed
array finalizers using it, so abuf->array_list is not
@@ -52706,7 +52706,7 @@ static void js_array_buffer_finalizer(JSRuntime *rt, JSValue val)
list_for_each_safe(el, el1, &abuf->array_list) {
JSTypedArray *ta;
JSObject *p1;
-
+
ta = list_entry(el, JSTypedArray, link);
ta->link.prev = NULL;
ta->link.next = NULL;
@@ -53051,7 +53051,7 @@ JSValue JS_GetTypedArrayBuffer(JSContext *ctx, JSValueConst obj,
}
return JS_DupValue(ctx, JS_MKPTR(JS_TAG_OBJECT, ta->buffer));
}
-
+
static JSValue js_typed_array_get_toStringTag(JSContext *ctx,
JSValueConst this_val)
{
@@ -53530,7 +53530,7 @@ static JSValue js_typed_array_fill(JSContext *ctx, JSValueConst this_val,
if (typed_array_is_detached(ctx, p))
return JS_ThrowTypeErrorDetachedArrayBuffer(ctx);
-
+
shift = typed_array_size_log2(p->class_id);
switch(shift) {
case 0:
@@ -53682,7 +53682,7 @@ static JSValue js_typed_array_indexOf(JSContext *ctx, JSValueConst this_val,
res = 0;
goto done;
}
-
+
is_bigint = 0;
is_int = 0; /* avoid warning */
v64 = 0; /* avoid warning */
@@ -53698,7 +53698,7 @@ static JSValue js_typed_array_indexOf(JSContext *ctx, JSValueConst this_val,
is_int = (v64 == d);
} else if (tag == JS_TAG_BIG_INT) {
JSBigFloat *p1 = JS_VALUE_GET_PTR(argv[0]);
-
+
if (p->class_id == JS_CLASS_BIG_INT64_ARRAY) {
if (bf_get_int64(&v64, &p1->num, 0) != 0)
goto done;
@@ -54342,7 +54342,7 @@ static JSValue js_typed_array_sort(JSContext *ctx, JSValueConst this_val,
uint32_t *array_idx;
void *array_tmp;
size_t i, j;
-
+
/* XXX: a stable sort would use less memory */
array_idx = js_malloc(ctx, len * sizeof(array_idx[0]));
if (!array_idx)
@@ -55147,7 +55147,7 @@ static JSValue js_atomics_op(JSContext *ctx,
}
switch(op | (size_log2 << 3)) {
-
+
#define OP(op_name, func_name) \
case ATOMICS_OP_ ## op_name | (0 << 3): \
a = func_name((_Atomic(uint8_t) *)ptr, v); \
@@ -55161,7 +55161,7 @@ static JSValue js_atomics_op(JSContext *ctx,
case ATOMICS_OP_ ## op_name | (3 << 3): \
a = func_name((_Atomic(uint64_t) *)ptr, v); \
break;
-
+
OP(ADD, atomic_fetch_add)
OP(AND, atomic_fetch_and)
OP(OR, atomic_fetch_or)
@@ -55182,7 +55182,7 @@ static JSValue js_atomics_op(JSContext *ctx,
case ATOMICS_OP_LOAD | (3 << 3):
a = atomic_load((_Atomic(uint64_t) *)ptr);
break;
-
+
case ATOMICS_OP_COMPARE_EXCHANGE | (0 << 3):
{
uint8_t v1 = v;
@@ -55343,7 +55343,7 @@ static JSValue js_atomics_wait(JSContext *ctx,
if (size_log2 == 3) {
if (JS_ToBigInt64(ctx, &v, argv[2]))
return JS_EXCEPTION;
- } else {
+ } else {
if (JS_ToInt32(ctx, &v32, argv[2]))
return JS_EXCEPTION;
v = v32;