revert instanceof use
This commit is contained in:
17
meson.build
17
meson.build
@@ -51,4 +51,19 @@ qjs = executable('qjs',
|
|||||||
'qjs.c', 'quickjs-libc.c', qjscalc_c, qjsrepl_c,
|
'qjs.c', 'quickjs-libc.c', qjscalc_c, qjsrepl_c,
|
||||||
dependencies: [quickjs_dep, threads],
|
dependencies: [quickjs_dep, threads],
|
||||||
build_by_default:false
|
build_by_default:false
|
||||||
)
|
)
|
||||||
|
|
||||||
|
test_root = join_paths(meson.project_source_root(), 'tests')
|
||||||
|
|
||||||
|
test('closure', qjs, args: ['test_closure.js'], workdir: test_root)
|
||||||
|
test('language', qjs, args: ['test_language.js'], workdir: test_root)
|
||||||
|
test('builtin', qjs, args: ['test_builtin.js'], workdir: test_root)
|
||||||
|
test('loop', qjs, args: ['test_loop.js'], workdir: test_root)
|
||||||
|
test('std', qjs, args: ['test_std.js'], workdir: test_root)
|
||||||
|
test('worker', qjs, args: ['test_worker.js'], workdir: test_root)
|
||||||
|
|
||||||
|
test('op_overloading', qjs, args: ['--bignum', 'test_op_overloading.js'], workdir: test_root)
|
||||||
|
test('bignum', qjs, args: ['--bignum', 'test_bignum.js'], workdir: test_root)
|
||||||
|
test('qjscalc', qjs, args: ['--qjscalc', 'test_qjscalc.js'], workdir: test_root)
|
||||||
|
|
||||||
|
benchmark('microbench', qjs, args: ['microbench.js'], workdir: test_root, timeout: 0)
|
||||||
2
qjs.c
2
qjs.c
@@ -512,7 +512,7 @@ int main(int argc, char **argv)
|
|||||||
if (dump_memory) {
|
if (dump_memory) {
|
||||||
JSMemoryUsage stats;
|
JSMemoryUsage stats;
|
||||||
JS_ComputeMemoryUsage(rt, &stats);
|
JS_ComputeMemoryUsage(rt, &stats);
|
||||||
JS_DumpMemoryUsage(stdout, &stats, rt);
|
// JS_DumpMemoryUsage(stdout, &stats, rt);
|
||||||
}
|
}
|
||||||
js_std_free_handlers(rt);
|
js_std_free_handlers(rt);
|
||||||
JS_FreeContext(ctx);
|
JS_FreeContext(ctx);
|
||||||
|
|||||||
@@ -736,7 +736,7 @@ static JSValue js_std_getenviron(JSContext *ctx, JSValueConst this_val,
|
|||||||
static JSValue js_std_gc(JSContext *ctx, JSValueConst this_val,
|
static JSValue js_std_gc(JSContext *ctx, JSValueConst this_val,
|
||||||
int argc, JSValueConst *argv)
|
int argc, JSValueConst *argv)
|
||||||
{
|
{
|
||||||
JS_RunGC(JS_GetRuntime(ctx), ctx);
|
JS_RunGC(JS_GetRuntime(ctx));
|
||||||
return JS_UNDEFINED;
|
return JS_UNDEFINED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7581,15 +7581,9 @@ static JSValue js_object_isPrototypeOf(JSContext *ctx, JSValueConst this_val, in
|
|||||||
/* return TRUE, FALSE or (-1) in case of exception */
|
/* return TRUE, FALSE or (-1) in case of exception */
|
||||||
int JS_IsInstanceOf(JSContext *ctx, JSValueConst val, JSValueConst obj)
|
int JS_IsInstanceOf(JSContext *ctx, JSValueConst val, JSValueConst obj)
|
||||||
{
|
{
|
||||||
JSValue ret = js_object_isPrototypeOf(ctx, obj, 1, &val);
|
|
||||||
int b = JS_ToBool(ctx,ret);
|
|
||||||
JS_FreeValue(ctx,ret);
|
|
||||||
return b;
|
|
||||||
/*
|
|
||||||
JSValue method;
|
JSValue method;
|
||||||
if (!JS_IsObject(obj))
|
if (!JS_IsObject(obj))
|
||||||
goto fail;
|
goto fail;
|
||||||
if (!JS_
|
|
||||||
method = JS_GetProperty(ctx, obj, JS_ATOM_Symbol_hasInstance);
|
method = JS_GetProperty(ctx, obj, JS_ATOM_Symbol_hasInstance);
|
||||||
if (JS_IsException(method))
|
if (JS_IsException(method))
|
||||||
return -1;
|
return -1;
|
||||||
@@ -7605,7 +7599,6 @@ int JS_IsInstanceOf(JSContext *ctx, JSValueConst val, JSValueConst obj)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
return JS_OrdinaryIsInstanceOf(ctx, val, obj);
|
return JS_OrdinaryIsInstanceOf(ctx, val, obj);
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* return the value associated to the autoinit property or an exception */
|
/* return the value associated to the autoinit property or an exception */
|
||||||
|
|||||||
Reference in New Issue
Block a user