diff options
author | Fabrice Bellard <fabrice@bellard.org> | 2025-03-25 16:33:47 +0100 |
---|---|---|
committer | Fabrice Bellard <fabrice@bellard.org> | 2025-03-25 16:33:47 +0100 |
commit | 6cc02b4421119627e56eecc9a371d7f02dc5ac1e (patch) | |
tree | 7a9bc842f49b82d7afd7174c519ee91268e633b7 /quickjs.h | |
parent | 156d981afeb07d7520ad75685e15b8dabd95f35a (diff) | |
download | quickjs-6cc02b4421119627e56eecc9a371d7f02dc5ac1e.tar.gz quickjs-6cc02b4421119627e56eecc9a371d7f02dc5ac1e.zip |
more use of js_new_string8 - inlined JS_NewString() (initial patch by Charlie Gordon)
Diffstat (limited to 'quickjs.h')
-rw-r--r-- | quickjs.h | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -715,7 +715,10 @@ int JS_ToBigInt64(JSContext *ctx, int64_t *pres, JSValueConst val); int JS_ToInt64Ext(JSContext *ctx, int64_t *pres, JSValueConst val); JSValue JS_NewStringLen(JSContext *ctx, const char *str1, size_t len1); -JSValue JS_NewString(JSContext *ctx, const char *str); +static inline JSValue JS_NewString(JSContext *ctx, const char *str) +{ + return JS_NewStringLen(ctx, str, strlen(str)); +} JSValue JS_NewAtomString(JSContext *ctx, const char *str); JSValue JS_ToString(JSContext *ctx, JSValueConst val); JSValue JS_ToPropertyKey(JSContext *ctx, JSValueConst val); |