}
-static JSValue
-njs_qjs_console_to_string_tag(JSContext *ctx, JSValueConst this_val)
-{
- return JS_NewString(ctx, "Console");
-}
-
-
static JSValue
njs_qjs_process_getter(JSContext *ctx, JSValueConst this_val)
{
static const JSCFunctionListEntry njs_qjs_console_proto[] = {
- JS_CGETSET_DEF("[Symbol.toStringTag]", njs_qjs_console_to_string_tag, NULL),
+ JS_PROP_STRING_DEF("[Symbol.toStringTag]", "Console",
+ JS_PROP_CONFIGURABLE),
JS_CFUNC_MAGIC_DEF("error", 0, njs_qjs_console_log, NJS_LOG_ERROR),
JS_CFUNC_MAGIC_DEF("info", 0, njs_qjs_console_log, NJS_LOG_INFO),
JS_CFUNC_MAGIC_DEF("log", 0, njs_qjs_console_log, NJS_LOG_INFO),
static JSValue qjs_fs_unlink(JSContext *cx, JSValueConst this_val,
int argc, JSValueConst *argv, int calltype);
-static JSValue qjs_fs_stats_to_string_tag(JSContext *cx, JSValueConst this_val);
static JSValue qjs_fs_stats_test(JSContext *cx, JSValueConst this_val, int argc,
JSValueConst *argv, int testtype);
static int qjs_fs_stats_get_own_property(JSContext *cx,
JSPropertyEnum **ptab, uint32_t *plen, JSValueConst obj);
static void qjs_fs_stats_finalizer(JSRuntime *rt, JSValue val);
-static JSValue qjs_fs_dirent_to_string_tag(JSContext *cx,
- JSValueConst this_val);
static JSValue qjs_fs_dirent_ctor(JSContext *cx, JSValueConst new_target,
int argc, JSValueConst *argv);
static JSValue qjs_fs_dirent_test(JSContext *cx, JSValueConst this_val,
int argc, JSValueConst *argv, int testtype);
-static JSValue qjs_fs_filehandle_to_string_tag(JSContext *cx,
- JSValueConst this_val);
static JSValue qjs_fs_filehandle_fd(JSContext *cx, JSValueConst this_val);
static JSValue qjs_fs_filehandle_value_of(JSContext *cx, JSValueConst this_val,
int argc, JSValueConst *argv);
static const JSCFunctionListEntry qjs_fs_stats_proto[] = {
- JS_CGETSET_DEF("[Symbol.toStringTag]", qjs_fs_stats_to_string_tag, NULL),
+ JS_PROP_STRING_DEF("[Symbol.toStringTag]", "Stats", JS_PROP_CONFIGURABLE),
JS_CFUNC_MAGIC_DEF("isBlockDevice", 0, qjs_fs_stats_test, DT_BLK),
JS_CFUNC_MAGIC_DEF("isCharacterDevice", 0, qjs_fs_stats_test, DT_CHR),
JS_CFUNC_MAGIC_DEF("isDirectory", 0, qjs_fs_stats_test, DT_DIR),
static const JSCFunctionListEntry qjs_fs_dirent_proto[] = {
- JS_CGETSET_DEF("[Symbol.toStringTag]", qjs_fs_dirent_to_string_tag, NULL),
+ JS_PROP_STRING_DEF("[Symbol.toStringTag]", "Dirent", JS_PROP_CONFIGURABLE),
JS_CFUNC_MAGIC_DEF("isBlockDevice", 0, qjs_fs_dirent_test, DT_BLK),
JS_CFUNC_MAGIC_DEF("isCharacterDevice", 0, qjs_fs_dirent_test, DT_CHR),
JS_CFUNC_MAGIC_DEF("isDirectory", 0, qjs_fs_dirent_test, DT_DIR),
static const JSCFunctionListEntry qjs_fs_filehandle_proto[] = {
- JS_CGETSET_DEF("[Symbol.toStringTag]", qjs_fs_filehandle_to_string_tag,
- NULL),
+ JS_PROP_STRING_DEF("[Symbol.toStringTag]", "FileHandle",
+ JS_PROP_CONFIGURABLE),
JS_CFUNC_MAGIC_DEF("close", 0, qjs_fs_close, QJS_FS_PROMISE),
JS_CGETSET_DEF("fd", qjs_fs_filehandle_fd, NULL),
JS_CFUNC_MAGIC_DEF("stat", 4, qjs_fs_stat,
}
-static JSValue
-qjs_fs_stats_to_string_tag(JSContext *cx, JSValueConst this_val)
-{
- return JS_NewString(cx, "Stats");
-}
-
-
static JSValue
qjs_fs_stats_test(JSContext *cx, JSValueConst this_val, int argc,
JSValueConst *argv, int testtype)
}
-static JSValue
-qjs_fs_dirent_to_string_tag(JSContext *cx, JSValueConst this_val)
-{
- return JS_NewString(cx, "Dirent");
-}
-
-
static JSValue
qjs_fs_dirent_test(JSContext *cx, JSValueConst this_val, int argc,
JSValueConst *argv, int testtype)
}
-static JSValue
-qjs_fs_filehandle_to_string_tag(JSContext *cx, JSValueConst this_val)
-{
- return JS_NewString(cx, "FileHandle");
-}
-
-
static JSValue
qjs_fs_filehandle_fd(JSContext *cx, JSValueConst thisval)
{
static JSValue qjs_webcrypto_sign(JSContext *cx, JSValueConst this_val,
int argc, JSValueConst *argv, int verify);
-static JSValue qjs_webcrypto_key_to_string_tag(JSContext *cx,
- JSValueConst this_val);
static JSValue qjs_webcrypto_key_algorithm(JSContext *cx,
JSValueConst this_val);
static JSValue qjs_webcrypto_key_extractable(JSContext *cx,
static const JSCFunctionListEntry qjs_webcrypto_key_proto[] = {
- JS_CGETSET_DEF("[Symbol.toStringTag]", qjs_webcrypto_key_to_string_tag,
- NULL),
+ JS_PROP_STRING_DEF("[Symbol.toStringTag]", "CryptoKey",
+ JS_PROP_CONFIGURABLE),
JS_CGETSET_DEF("algorithm", qjs_webcrypto_key_algorithm, NULL),
JS_CGETSET_DEF("extractable", qjs_webcrypto_key_extractable, NULL),
JS_CGETSET_DEF("type", qjs_webcrypto_key_type, NULL),
}
-static JSValue
-qjs_webcrypto_key_to_string_tag(JSContext *cx, JSValueConst this_val)
-{
- return JS_NewString(cx, "CryptoKey");
-}
-
-
static JSValue
qjs_webcrypto_key_algorithm(JSContext *cx, JSValueConst this_val)
{
njs_value_t *retval);
#if (NJS_HAVE_QUICKJS)
-static JSValue ngx_http_qjs_ext_to_string_tag(JSContext *cx,
- JSValueConst this_val);
static JSValue ngx_http_qjs_ext_args(JSContext *cx, JSValueConst this_val);
static JSValue ngx_http_qjs_ext_done(JSContext *cx, JSValueConst this_val,
int argc, JSValueConst *argv);
JSValueConst this_val, int argc, JSValueConst *argv);
static JSValue ngx_http_qjs_ext_log(JSContext *cx, JSValueConst this_val,
int argc, JSValueConst *argv, int level);
-static JSValue ngx_http_qjs_ext_periodic_to_string_tag(JSContext *cx,
- JSValueConst this_val);
static JSValue ngx_http_qjs_ext_periodic_variables(JSContext *cx,
JSValueConst this_val, int type);
static JSValue ngx_http_qjs_ext_parent(JSContext *cx, JSValueConst this_val);
#if (NJS_HAVE_QUICKJS)
static const JSCFunctionListEntry ngx_http_qjs_ext_request[] = {
- JS_CGETSET_DEF("[Symbol.toStringTag]", ngx_http_qjs_ext_to_string_tag,
- NULL),
+ JS_PROP_STRING_DEF("[Symbol.toStringTag]", "Request", JS_PROP_CONFIGURABLE),
JS_CGETSET_DEF("args", ngx_http_qjs_ext_args, NULL),
JS_CFUNC_DEF("done", 0, ngx_http_qjs_ext_done),
JS_CFUNC_MAGIC_DEF("error", 1, ngx_http_qjs_ext_log, NGX_LOG_ERR),
static const JSCFunctionListEntry ngx_http_qjs_ext_periodic[] = {
- JS_CGETSET_DEF("[Symbol.toStringTag]",
- ngx_http_qjs_ext_periodic_to_string_tag, NULL),
+ JS_PROP_STRING_DEF("[Symbol.toStringTag]", "PeriodicSession",
+ JS_PROP_CONFIGURABLE),
JS_CGETSET_MAGIC_DEF("rawVariables", ngx_http_qjs_ext_periodic_variables,
NULL, NGX_JS_BUFFER),
JS_CGETSET_MAGIC_DEF("variables", ngx_http_qjs_ext_periodic_variables,
}
-static JSValue
-ngx_http_qjs_ext_to_string_tag(JSContext *cx,
- JSValueConst this_val)
-{
- return JS_NewString(cx, "Request");
-}
-
-
static JSValue
ngx_http_qjs_ext_args(JSContext *cx, JSValueConst this_val)
{
}
-static JSValue
-ngx_http_qjs_ext_periodic_to_string_tag(JSContext *cx,
- JSValueConst this_val)
-{
- return JS_NewString(cx, "PeriodicSession");
-}
-
-
static JSValue
ngx_http_qjs_ext_periodic_variables(JSContext *cx,
JSValueConst this_val, int type)
int argc, JSValueConst *argv, int flags);
static JSValue ngx_qjs_ext_shared_dict_size(JSContext *cx,
JSValueConst this_val, int argc, JSValueConst *argv);
-static JSValue ngx_qjs_ext_shared_dict_tag(JSContext *cx,
- JSValueConst this_val);
-static JSValue ngx_qjs_ext_shared_dict_type(JSContext *cx,
+ static JSValue ngx_qjs_ext_shared_dict_type(JSContext *cx,
JSValueConst this_val);
static JSValue ngx_qjs_dict_copy_value_locked(JSContext *cx,
};
static const JSCFunctionListEntry ngx_qjs_ext_shared_dict[] = {
- JS_CGETSET_DEF("[Symbol.toStringTag]", ngx_qjs_ext_shared_dict_tag, NULL),
+ JS_PROP_STRING_DEF("[Symbol.toStringTag]", "SharedDict",
+ JS_PROP_CONFIGURABLE),
JS_CFUNC_MAGIC_DEF("add", 3, ngx_qjs_ext_shared_dict_set,
NGX_JS_DICT_FLAG_MUST_NOT_EXIST),
JS_CGETSET_DEF("capacity", ngx_qjs_ext_shared_dict_capacity, NULL),
}
-static JSValue
-ngx_qjs_ext_shared_dict_tag(JSContext *cx, JSValueConst this_val)
-{
- return JS_NewString(cx, "SharedDict");
-}
-
-
static JSValue
ngx_qjs_ext_shared_dict_type(JSContext *cx, JSValueConst this_val)
{
#if (NJS_HAVE_QUICKJS)
-static JSValue ngx_stream_qjs_ext_to_string_tag(JSContext *cx,
- JSValueConst this_val);
static JSValue ngx_stream_qjs_ext_done(JSContext *cx, JSValueConst this_val,
int argc, JSValueConst *argv, int magic);
static JSValue ngx_stream_qjs_ext_log(JSContext *cx, JSValueConst this_val,
int argc, JSValueConst *argv);
static JSValue ngx_stream_qjs_ext_off(JSContext *cx, JSValueConst this_val,
int argc, JSValueConst *argv);
-static JSValue ngx_stream_qjs_ext_periodic_to_string_tag(JSContext *cx,
- JSValueConst this_val);
static JSValue ngx_stream_qjs_ext_periodic_variables(JSContext *cx,
JSValueConst this_val, int type);
static JSValue ngx_stream_qjs_ext_remote_address(JSContext *cx,
#if (NJS_HAVE_QUICKJS)
static const JSCFunctionListEntry ngx_stream_qjs_ext_session[] = {
- JS_CGETSET_DEF("[Symbol.toStringTag]", ngx_stream_qjs_ext_to_string_tag,
- NULL),
+ JS_PROP_STRING_DEF("[Symbol.toStringTag]", "Stream Session",
+ JS_PROP_CONFIGURABLE),
JS_CFUNC_MAGIC_DEF("allow", 1, ngx_stream_qjs_ext_done, NGX_OK),
JS_CFUNC_MAGIC_DEF("decline", 1, ngx_stream_qjs_ext_done, -NGX_DECLINED),
JS_CFUNC_MAGIC_DEF("deny", 1, ngx_stream_qjs_ext_done, -NGX_DONE),
static const JSCFunctionListEntry ngx_stream_qjs_ext_periodic[] = {
- JS_CGETSET_DEF("[Symbol.toStringTag]",
- ngx_stream_qjs_ext_periodic_to_string_tag, NULL),
+ JS_PROP_STRING_DEF("[Symbol.toStringTag]", "PeriodicSession",
+ JS_PROP_CONFIGURABLE),
JS_CGETSET_MAGIC_DEF("rawVariables", ngx_stream_qjs_ext_periodic_variables,
NULL, NGX_JS_BUFFER),
JS_CGETSET_MAGIC_DEF("variables", ngx_stream_qjs_ext_periodic_variables,
#if (NJS_HAVE_QUICKJS)
-static JSValue
-ngx_stream_qjs_ext_to_string_tag(JSContext *cx, JSValueConst this_val)
-{
- return JS_NewString(cx, "Stream Session");
-}
-
-
static JSValue
ngx_stream_qjs_ext_done(JSContext *cx, JSValueConst this_val, int argc,
JSValueConst *argv, int magic)
}
-static JSValue
-ngx_stream_qjs_ext_periodic_to_string_tag(JSContext *cx,
- JSValueConst this_val)
-{
- return JS_NewString(cx, "PeriodicSession");
-}
-
-
static JSValue
ngx_stream_qjs_ext_periodic_variables(JSContext *cx,
JSValueConst this_val, int type)
static JSValue qjs_njs_getter(JSContext *ctx, JSValueConst this_val);
-static JSValue qjs_njs_to_string_tag(JSContext *ctx, JSValueConst this_val);
-static JSValue qjs_process_to_string_tag(JSContext *ctx, JSValueConst this_val);
static JSValue qjs_process_env(JSContext *ctx, JSValueConst this_val);
static JSValue qjs_process_kill(JSContext *ctx, JSValueConst this_val,
int argc, JSValueConst *argv);
static JSValue qjs_process_ppid(JSContext *ctx, JSValueConst this_val);
static int qjs_add_intrinsic_text_decoder(JSContext *cx, JSValueConst global);
-static JSValue qjs_text_decoder_to_string_tag(JSContext *ctx,
- JSValueConst this_val);
static JSValue qjs_text_decoder_decode(JSContext *ctx, JSValueConst this_val,
int argc, JSValueConst *argv);
static JSValue qjs_text_decoder_encoding(JSContext *ctx, JSValueConst this_val);
static void qjs_text_decoder_finalizer(JSRuntime *rt, JSValue val);
static int qjs_add_intrinsic_text_encoder(JSContext *cx, JSValueConst global);
-static JSValue qjs_text_encoder_to_string_tag(JSContext *ctx,
- JSValueConst this_val);
static JSValue qjs_text_encoder_encode(JSContext *ctx, JSValueConst this_val,
int argc, JSValueConst *argv);
static JSValue qjs_text_encoder_encode_into(JSContext *ctx,
};
static const JSCFunctionListEntry qjs_text_decoder_proto[] = {
- JS_CGETSET_DEF("[Symbol.toStringTag]", qjs_text_decoder_to_string_tag,
- NULL),
+ JS_PROP_STRING_DEF("[Symbol.toStringTag]", "TextDecoder",
+ JS_PROP_CONFIGURABLE),
JS_CFUNC_DEF("decode", 1, qjs_text_decoder_decode),
JS_CGETSET_DEF("encoding", qjs_text_decoder_encoding, NULL),
JS_CGETSET_DEF("fatal", qjs_text_decoder_fatal, NULL),
};
static const JSCFunctionListEntry qjs_text_encoder_proto[] = {
- JS_CGETSET_DEF("[Symbol.toStringTag]", qjs_text_encoder_to_string_tag,
- NULL),
+ JS_PROP_STRING_DEF("[Symbol.toStringTag]", "TextEncoder",
+ JS_PROP_CONFIGURABLE),
JS_CFUNC_DEF("encode", 1, qjs_text_encoder_encode),
JS_CFUNC_DEF("encodeInto", 1, qjs_text_encoder_encode_into),
JS_CGETSET_DEF("encoding", qjs_text_encoder_encoding, NULL),
};
static const JSCFunctionListEntry qjs_njs_proto[] = {
- JS_CGETSET_DEF("[Symbol.toStringTag]", qjs_njs_to_string_tag, NULL),
+ JS_PROP_STRING_DEF("[Symbol.toStringTag]", "njs", JS_PROP_CONFIGURABLE),
JS_PROP_STRING_DEF("version", NJS_VERSION, JS_PROP_C_W_E),
JS_PROP_INT32_DEF("version_number", NJS_VERSION_NUMBER,
JS_PROP_C_W_E),
};
static const JSCFunctionListEntry qjs_process_proto[] = {
- JS_CGETSET_DEF("[Symbol.toStringTag]", qjs_process_to_string_tag, NULL),
+ JS_PROP_STRING_DEF("[Symbol.toStringTag]", "process", JS_PROP_CONFIGURABLE),
JS_CGETSET_DEF("env", qjs_process_env, NULL),
JS_CFUNC_DEF("kill", 2, qjs_process_kill),
JS_CGETSET_DEF("pid", qjs_process_pid, NULL),
}
-static JSValue
-qjs_njs_to_string_tag(JSContext *ctx, JSValueConst this_val)
-{
- return JS_NewString(ctx, "njs");
-}
-
-
-static JSValue
-qjs_process_to_string_tag(JSContext *ctx, JSValueConst this_val)
-{
- return JS_NewString(ctx, "process");
-}
-
-
static JSValue
qjs_process_env(JSContext *ctx, JSValueConst this_val)
{
}
-static JSValue
-qjs_text_decoder_to_string_tag(JSContext *ctx, JSValueConst this_val)
-{
- return JS_NewString(ctx, "TextDecoder");
-}
-
-
static JSValue
qjs_text_decoder_decode(JSContext *cx, JSValueConst this_val, int argc,
JSValueConst *argv)
}
-static JSValue
-qjs_text_encoder_to_string_tag(JSContext *ctx, JSValueConst this_val)
-{
- return JS_NewString(ctx, "TextEncoder");
-}
-
-
static JSValue
qjs_text_encoder_encoding(JSContext *ctx, JSValueConst this_val)
{