@@ -14945,7 +14945,7 @@ static JSValue JS_CallInternal(JSContext *caller_ctx, JSValue func_obj,
14945
14945
int n = min_int(argc, b->arg_count);
14946
14946
arg_buf = local_buf;
14947
14947
for(i = 0; i < n; i++)
14948
- arg_buf[i] = JS_DupValue(caller_ctx, argv[i]);
14948
+ arg_buf[i] = js_dup( argv[i]);
14949
14949
for(; i < b->arg_count; i++)
14950
14950
arg_buf[i] = JS_UNDEFINED;
14951
14951
sf->arg_count = b->arg_count;
@@ -20437,7 +20437,7 @@ static __exception int emit_push_const(JSParseState *s, JSValue val,
20437
20437
if (JS_VALUE_GET_TAG(val) == JS_TAG_STRING && as_atom) {
20438
20438
JSAtom atom;
20439
20439
/* warning: JS_NewAtomStr frees the string value */
20440
- JS_DupValue(s->ctx, val);
20440
+ js_dup( val);
20441
20441
atom = JS_NewAtomStr(s->ctx, JS_VALUE_GET_STRING(val));
20442
20442
if (atom != JS_ATOM_NULL && !__JS_AtomIsTaggedInt(atom)) {
20443
20443
emit_op(s, OP_push_atom_value);
@@ -20446,7 +20446,7 @@ static __exception int emit_push_const(JSParseState *s, JSValue val,
20446
20446
}
20447
20447
}
20448
20448
20449
- idx = cpool_add(s, JS_DupValue(s->ctx, val));
20449
+ idx = cpool_add(s, js_dup( val));
20450
20450
if (idx < 0)
20451
20451
return -1;
20452
20452
emit_op(s, OP_push_const);
@@ -27334,7 +27334,7 @@ static JSValue js_import_meta(JSContext *ctx)
27334
27334
27335
27335
static JSValue JS_NewModuleValue(JSContext *ctx, JSModuleDef *m)
27336
27336
{
27337
- return JS_DupValue(ctx, JS_MKPTR(JS_TAG_MODULE, m));
27337
+ return js_dup( JS_MKPTR(JS_TAG_MODULE, m));
27338
27338
}
27339
27339
27340
27340
static JSValue js_load_module_rejected(JSContext *ctx, JSValue this_val,
@@ -27603,7 +27603,7 @@ static JSValue js_async_module_execution_rejected(JSContext *ctx, JSValue this_v
27603
27603
assert(module->async_evaluation);
27604
27604
27605
27605
module->eval_has_exception = true;
27606
- module->eval_exception = JS_DupValue(ctx, error);
27606
+ module->eval_exception = js_dup( error);
27607
27607
module->status = JS_MODULE_STATUS_EVALUATED;
27608
27608
27609
27609
for(i = 0; i < module->async_parent_modules_count; i++) {
@@ -27756,7 +27756,7 @@ static int js_inner_module_evaluation(JSContext *ctx, JSModuleDef *m,
27756
27756
if (m->status == JS_MODULE_STATUS_EVALUATING_ASYNC ||
27757
27757
m->status == JS_MODULE_STATUS_EVALUATED) {
27758
27758
if (m->eval_has_exception) {
27759
- *pvalue = JS_DupValue(ctx, m->eval_exception);
27759
+ *pvalue = js_dup( m->eval_exception);
27760
27760
return -1;
27761
27761
} else {
27762
27762
*pvalue = JS_UNDEFINED;
@@ -27795,7 +27795,7 @@ static int js_inner_module_evaluation(JSContext *ctx, JSModuleDef *m,
27795
27795
assert(m1->status == JS_MODULE_STATUS_EVALUATING_ASYNC ||
27796
27796
m1->status == JS_MODULE_STATUS_EVALUATED);
27797
27797
if (m1->eval_has_exception) {
27798
- *pvalue = JS_DupValue(ctx, m1->eval_exception);
27798
+ *pvalue = js_dup( m1->eval_exception);
27799
27799
return -1;
27800
27800
}
27801
27801
}
@@ -27862,7 +27862,7 @@ static JSValue js_evaluate_module(JSContext *ctx, JSModuleDef *m)
27862
27862
}
27863
27863
/* a promise may be created only on the cycle_root of a cycle */
27864
27864
if (!JS_IsUndefined(m->promise))
27865
- return JS_DupValue(ctx, m->promise);
27865
+ return js_dup( m->promise);
27866
27866
m->promise = JS_NewPromiseCapability(ctx, m->resolving_funcs);
27867
27867
if (JS_IsException(m->promise))
27868
27868
return JS_EXCEPTION;
@@ -27874,7 +27874,7 @@ static JSValue js_evaluate_module(JSContext *ctx, JSModuleDef *m)
27874
27874
assert(m1->status == JS_MODULE_STATUS_EVALUATING);
27875
27875
m1->status = JS_MODULE_STATUS_EVALUATED;
27876
27876
m1->eval_has_exception = true;
27877
- m1->eval_exception = JS_DupValue(ctx, result);
27877
+ m1->eval_exception = js_dup( result);
27878
27878
m1->cycle_root = m; /* spec bug: should be present */
27879
27879
stack_top = m1->stack_prev;
27880
27880
}
@@ -27898,7 +27898,7 @@ static JSValue js_evaluate_module(JSContext *ctx, JSModuleDef *m)
27898
27898
}
27899
27899
assert(stack_top == NULL);
27900
27900
}
27901
- return JS_DupValue(ctx, m->promise);
27901
+ return js_dup( m->promise);
27902
27902
}
27903
27903
27904
27904
static __exception JSAtom js_parse_from_clause(JSParseState *s)
@@ -48469,7 +48469,7 @@ JSValue JS_PromiseResult(JSContext *ctx, JSValue promise)
48469
48469
JSPromiseData *s = JS_GetOpaque(promise, JS_CLASS_PROMISE);
48470
48470
if (!s)
48471
48471
return JS_UNDEFINED;
48472
- return JS_DupValue(ctx, s->promise_result);
48472
+ return js_dup( s->promise_result);
48473
48473
}
48474
48474
48475
48475
bool JS_IsPromise(JSValue val)
0 commit comments