quickjs 0.1.11 → 0.1.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/ext/quickjsrb/quickjsrb.c +226 -30
- data/lib/quickjs/version.rb +1 -1
- data/lib/quickjs.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 12a5b713531ad393cb5d16486516f3288eb2b9c88931b8db5fa440a4701393df
|
4
|
+
data.tar.gz: c780fe075e29223e90a4f0183b02506ed2209ed2f17dd33e9e734e753a9b0b3d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 524a227ede71099f8da470ae3178df0c63fab2613cb3e9a37ec0215d462dab2fbbb52f69449273cf58ffc58758dbab8743be624c75ce0818335e86b312e49bda
|
7
|
+
data.tar.gz: 9602f54b31a71163ce054aaad3b6da4b5e00d1866b63e98617971d3279ba3a5cef9c8aa2ade1e130dd4499c121c62cc94a8a48dc3eba92a8eaf7bd1a2093ef56
|
data/ext/quickjsrb/quickjsrb.c
CHANGED
@@ -11,6 +11,7 @@ typedef struct VMData
|
|
11
11
|
struct JSContext *context;
|
12
12
|
VALUE defined_functions;
|
13
13
|
struct EvalTime *eval_time;
|
14
|
+
VALUE logs;
|
14
15
|
} VMData;
|
15
16
|
|
16
17
|
static void vm_free(void *ptr)
|
@@ -36,6 +37,7 @@ static void vm_mark(void *ptr)
|
|
36
37
|
{
|
37
38
|
VMData *data = (VMData *)ptr;
|
38
39
|
rb_gc_mark_movable(data->defined_functions);
|
40
|
+
rb_gc_mark_movable(data->logs);
|
39
41
|
}
|
40
42
|
|
41
43
|
static const rb_data_type_t vm_type = {
|
@@ -53,6 +55,7 @@ static VALUE vm_alloc(VALUE r_self)
|
|
53
55
|
VMData *data;
|
54
56
|
VALUE obj = TypedData_Make_Struct(r_self, VMData, &vm_type, data);
|
55
57
|
data->defined_functions = rb_hash_new();
|
58
|
+
data->logs = rb_ary_new();
|
56
59
|
|
57
60
|
EvalTime *eval_time = malloc(sizeof(EvalTime));
|
58
61
|
data->eval_time = eval_time;
|
@@ -63,7 +66,7 @@ static VALUE vm_alloc(VALUE r_self)
|
|
63
66
|
return obj;
|
64
67
|
}
|
65
68
|
|
66
|
-
VALUE
|
69
|
+
VALUE rb_cQuickjsVMLog, rb_cQuickjsSyntaxError, rb_cQuickjsRuntimeError, rb_cQuickjsInterruptedError, rb_cQuickjsNoAwaitError, rb_cQuickjsTypeError, rb_cQuickjsReferenceError, rb_cQuickjsRangeError, rb_cQuickjsEvalError, rb_cQuickjsURIError, rb_cQuickjsAggregateError;
|
67
70
|
const char *undefinedId = "undefined";
|
68
71
|
const char *nanId = "NaN";
|
69
72
|
|
@@ -78,11 +81,13 @@ JSValue to_js_value(JSContext *ctx, VALUE r_value)
|
|
78
81
|
rb_intern("is_a?"),
|
79
82
|
1, rb_const_get(rb_cClass, rb_intern("Exception")))))
|
80
83
|
{
|
81
|
-
VALUE r_str = rb_funcall(r_value, rb_intern("message"), 0, NULL);
|
82
|
-
char *str = StringValueCStr(r_str);
|
83
84
|
JSValue j_error = JS_NewError(ctx);
|
84
|
-
|
85
|
-
|
85
|
+
VALUE r_str = rb_funcall(r_value, rb_intern("message"), 0, NULL);
|
86
|
+
char *exceptionMessage = StringValueCStr(r_str);
|
87
|
+
VALUE r_exception_name = rb_funcall(rb_funcall(r_value, rb_intern("class"), 0, NULL), rb_intern("name"), 0, NULL);
|
88
|
+
char *exceptionName = StringValueCStr(r_exception_name);
|
89
|
+
JS_SetPropertyStr(ctx, j_error, "name", JS_NewString(ctx, exceptionName));
|
90
|
+
JS_SetPropertyStr(ctx, j_error, "message", JS_NewString(ctx, exceptionMessage));
|
86
91
|
return JS_Throw(ctx, j_error);
|
87
92
|
}
|
88
93
|
|
@@ -225,19 +230,67 @@ VALUE to_rb_value(JSContext *ctx, JSValue j_val)
|
|
225
230
|
JS_FreeValue(ctx, j_errorClassName);
|
226
231
|
|
227
232
|
VALUE r_error_message = rb_sprintf("%s: %s", errorClassName, errorClassMessage);
|
233
|
+
VALUE r_error_class = rb_eRuntimeError;
|
234
|
+
|
235
|
+
if (strcmp(errorClassName, "SyntaxError") == 0)
|
236
|
+
{
|
237
|
+
r_error_class = rb_cQuickjsSyntaxError;
|
238
|
+
r_error_message = rb_str_new2(errorClassMessage);
|
239
|
+
}
|
240
|
+
else if (strcmp(errorClassName, "TypeError") == 0)
|
241
|
+
{
|
242
|
+
r_error_class = rb_cQuickjsTypeError;
|
243
|
+
r_error_message = rb_str_new2(errorClassMessage);
|
244
|
+
}
|
245
|
+
else if (strcmp(errorClassName, "ReferenceError") == 0)
|
246
|
+
{
|
247
|
+
r_error_class = rb_cQuickjsReferenceError;
|
248
|
+
r_error_message = rb_str_new2(errorClassMessage);
|
249
|
+
}
|
250
|
+
else if (strcmp(errorClassName, "RangeError") == 0)
|
251
|
+
{
|
252
|
+
r_error_class = rb_cQuickjsRangeError;
|
253
|
+
r_error_message = rb_str_new2(errorClassMessage);
|
254
|
+
}
|
255
|
+
else if (strcmp(errorClassName, "EvalError") == 0)
|
256
|
+
{
|
257
|
+
r_error_class = rb_cQuickjsEvalError;
|
258
|
+
r_error_message = rb_str_new2(errorClassMessage);
|
259
|
+
}
|
260
|
+
else if (strcmp(errorClassName, "URIError") == 0)
|
261
|
+
{
|
262
|
+
r_error_class = rb_cQuickjsURIError;
|
263
|
+
r_error_message = rb_str_new2(errorClassMessage);
|
264
|
+
}
|
265
|
+
else if (strcmp(errorClassName, "AggregateError") == 0)
|
266
|
+
{
|
267
|
+
r_error_class = rb_cQuickjsAggregateError;
|
268
|
+
r_error_message = rb_str_new2(errorClassMessage);
|
269
|
+
}
|
270
|
+
else if (strcmp(errorClassName, "InternalError") == 0 && strstr(errorClassMessage, "interrupted") != NULL)
|
271
|
+
{
|
272
|
+
r_error_class = rb_cQuickjsInterruptedError;
|
273
|
+
r_error_message = rb_str_new2("Code evaluation is interrupted by the timeout or something");
|
274
|
+
}
|
275
|
+
else if (strcmp(errorClassName, "Quickjs::InterruptedError") == 0)
|
276
|
+
{
|
277
|
+
r_error_class = rb_cQuickjsInterruptedError;
|
278
|
+
r_error_message = rb_str_new2(errorClassMessage);
|
279
|
+
}
|
228
280
|
JS_FreeCString(ctx, errorClassName);
|
229
281
|
JS_FreeCString(ctx, errorClassMessage);
|
230
282
|
JS_FreeValue(ctx, j_exceptionVal);
|
231
|
-
|
283
|
+
|
284
|
+
rb_exc_raise(rb_exc_new_str(r_error_class, r_error_message));
|
232
285
|
}
|
233
|
-
else
|
286
|
+
else // exception without Error object
|
234
287
|
{
|
235
288
|
const char *errorMessage = JS_ToCString(ctx, j_exceptionVal);
|
236
289
|
VALUE r_error_message = rb_sprintf("%s", errorMessage);
|
237
290
|
|
238
291
|
JS_FreeCString(ctx, errorMessage);
|
239
292
|
JS_FreeValue(ctx, j_exceptionVal);
|
240
|
-
rb_exc_raise(rb_exc_new_str(
|
293
|
+
rb_exc_raise(rb_exc_new_str(rb_cQuickjsRuntimeError, r_error_message));
|
241
294
|
}
|
242
295
|
return Qnil;
|
243
296
|
}
|
@@ -287,6 +340,41 @@ static JSValue js_quickjsrb_call_global(JSContext *ctx, JSValueConst _this, int
|
|
287
340
|
return to_js_value(ctx, r_result);
|
288
341
|
}
|
289
342
|
|
343
|
+
static JSValue js_quickjsrb_log(JSContext *ctx, JSValueConst _this, int _argc, JSValueConst *argv)
|
344
|
+
{
|
345
|
+
VMData *data = JS_GetContextOpaque(ctx);
|
346
|
+
JSValue j_severity = JS_ToString(ctx, argv[0]);
|
347
|
+
const char *severity = JS_ToCString(ctx, j_severity);
|
348
|
+
JS_FreeValue(ctx, j_severity);
|
349
|
+
|
350
|
+
VALUE r_log = rb_funcall(rb_cQuickjsVMLog, rb_intern("new"), 0);
|
351
|
+
rb_iv_set(r_log, "@severity", ID2SYM(rb_intern(severity)));
|
352
|
+
|
353
|
+
VALUE r_row = rb_ary_new();
|
354
|
+
int i;
|
355
|
+
JSValue j_length = JS_GetPropertyStr(ctx, argv[1], "length");
|
356
|
+
int count;
|
357
|
+
JS_ToInt32(ctx, &count, j_length);
|
358
|
+
JS_FreeValue(ctx, j_length);
|
359
|
+
for (i = 0; i < count; i++)
|
360
|
+
{
|
361
|
+
JSValue j_logged = JS_GetPropertyUint32(ctx, argv[1], i);
|
362
|
+
const char *body = JS_ToCString(ctx, j_logged);
|
363
|
+
VALUE r_loghash = rb_hash_new();
|
364
|
+
rb_hash_aset(r_loghash, ID2SYM(rb_intern("c")), rb_str_new2(body));
|
365
|
+
rb_hash_aset(r_loghash, ID2SYM(rb_intern("raw")), to_rb_value(ctx, j_logged));
|
366
|
+
rb_ary_push(r_row, r_loghash);
|
367
|
+
JS_FreeValue(ctx, j_logged);
|
368
|
+
JS_FreeCString(ctx, body);
|
369
|
+
}
|
370
|
+
|
371
|
+
rb_iv_set(r_log, "@row", r_row);
|
372
|
+
rb_ary_push(data->logs, r_log);
|
373
|
+
JS_FreeCString(ctx, severity);
|
374
|
+
|
375
|
+
return JS_UNDEFINED;
|
376
|
+
}
|
377
|
+
|
290
378
|
static VALUE vm_m_initialize(int argc, VALUE *argv, VALUE r_self)
|
291
379
|
{
|
292
380
|
VALUE r_opts;
|
@@ -321,7 +409,6 @@ static VALUE vm_m_initialize(int argc, VALUE *argv, VALUE r_self)
|
|
321
409
|
JS_AddIntrinsicBigDecimal(data->context);
|
322
410
|
JS_AddIntrinsicOperators(data->context);
|
323
411
|
JS_EnableBignumExt(data->context, TRUE);
|
324
|
-
js_std_add_helpers(data->context, 0, NULL);
|
325
412
|
|
326
413
|
JS_SetModuleLoaderFunc(runtime, NULL, js_module_loader, NULL);
|
327
414
|
js_std_init_handlers(runtime);
|
@@ -353,15 +440,29 @@ static VALUE vm_m_initialize(int argc, VALUE *argv, VALUE r_self)
|
|
353
440
|
JS_FreeValue(data->context, j_timeoutEval);
|
354
441
|
}
|
355
442
|
|
356
|
-
const char *setupGlobalRuby = "globalThis.__ruby = {};\n";
|
357
|
-
JSValue j_rubyEval = JS_Eval(data->context, setupGlobalRuby, strlen(setupGlobalRuby), "<vm>", JS_EVAL_TYPE_MODULE);
|
358
|
-
JS_FreeValue(data->context, j_rubyEval);
|
359
|
-
|
360
443
|
JSValue j_global = JS_GetGlobalObject(data->context);
|
361
|
-
JSValue
|
362
|
-
JS_SetPropertyStr(
|
444
|
+
JSValue j_quickjsrbGlobal = JS_NewObject(data->context);
|
445
|
+
JS_SetPropertyStr(
|
446
|
+
data->context, j_quickjsrbGlobal, "runRubyMethod",
|
447
|
+
JS_NewCFunction(data->context, js_quickjsrb_call_global, "runRubyMethod", 2));
|
448
|
+
|
449
|
+
JS_SetPropertyStr(data->context, j_global, "__quickjsrb", j_quickjsrbGlobal);
|
450
|
+
|
451
|
+
JSValue j_console = JS_NewObject(data->context);
|
452
|
+
JS_SetPropertyStr(
|
453
|
+
data->context, j_quickjsrbGlobal, "log",
|
454
|
+
JS_NewCFunction(data->context, js_quickjsrb_log, "log", 2));
|
455
|
+
JS_SetPropertyStr(data->context, j_global, "console", j_console);
|
363
456
|
JS_FreeValue(data->context, j_global);
|
364
457
|
|
458
|
+
const char *defineLoggers = "console.log = (...args) => __quickjsrb.log('info', args);\n"
|
459
|
+
"console.debug = (...args) => __quickjsrb.log('verbose', args);\n"
|
460
|
+
"console.info = (...args) => __quickjsrb.log('info', args);\n"
|
461
|
+
"console.warn = (...args) => __quickjsrb.log('warning', args);\n"
|
462
|
+
"console.error = (...args) => __quickjsrb.log('error', args);\n";
|
463
|
+
JSValue j_defineLoggers = JS_Eval(data->context, defineLoggers, strlen(defineLoggers), "<vm>", JS_EVAL_TYPE_GLOBAL);
|
464
|
+
JS_FreeValue(data->context, j_defineLoggers);
|
465
|
+
|
365
466
|
return r_self;
|
366
467
|
}
|
367
468
|
|
@@ -389,7 +490,7 @@ static VALUE vm_m_evalCode(VALUE r_self, VALUE r_code)
|
|
389
490
|
JS_FreeValue(data->context, j_returnedValue);
|
390
491
|
JS_FreeValue(data->context, j_awaitedResult);
|
391
492
|
VALUE r_error_message = rb_str_new2("An unawaited Promise was returned to the top-level");
|
392
|
-
rb_exc_raise(rb_exc_new_str(
|
493
|
+
rb_exc_raise(rb_exc_new_str(rb_cQuickjsNoAwaitError, r_error_message));
|
393
494
|
return Qnil;
|
394
495
|
}
|
395
496
|
else
|
@@ -414,11 +515,10 @@ static VALUE vm_m_defineGlobalFunction(VALUE r_self, VALUE r_name)
|
|
414
515
|
rb_hash_aset(data->defined_functions, r_name, r_proc);
|
415
516
|
char *funcName = StringValueCStr(r_name);
|
416
517
|
|
417
|
-
const char *template = "globalThis
|
418
|
-
|
419
|
-
int length = snprintf(NULL, 0, template, funcName, funcName, funcName, funcName);
|
518
|
+
const char *template = "globalThis['%s'] = (...args) => __quickjsrb.runRubyMethod('%s', args);\n";
|
519
|
+
int length = snprintf(NULL, 0, template, funcName, funcName);
|
420
520
|
char *result = (char *)malloc(length + 1);
|
421
|
-
snprintf(result, length + 1, template, funcName, funcName
|
521
|
+
snprintf(result, length + 1, template, funcName, funcName);
|
422
522
|
|
423
523
|
JSValue j_codeResult = JS_Eval(data->context, result, strlen(result), "<vm>", JS_EVAL_TYPE_MODULE);
|
424
524
|
|
@@ -430,21 +530,117 @@ static VALUE vm_m_defineGlobalFunction(VALUE r_self, VALUE r_name)
|
|
430
530
|
return Qnil;
|
431
531
|
}
|
432
532
|
|
533
|
+
// WISH: vm.import('hey', from: '...source...') imports just default
|
534
|
+
// WISH: vm.import('{ member, member2 }', from: '...source...')
|
535
|
+
// WISH: vm.import('{ member as aliasedName }', from: '...source...')
|
536
|
+
// WISH: vm.import('defaultMember, { member }', from: '...source...')
|
537
|
+
// WISH: vm.import('* as all', from: '...source...')
|
538
|
+
static VALUE vm_m_import(int argc, VALUE *argv, VALUE r_self)
|
539
|
+
{
|
540
|
+
VALUE r_import_string, r_opts;
|
541
|
+
rb_scan_args(argc, argv, "10:", &r_import_string, &r_opts);
|
542
|
+
if (NIL_P(r_opts))
|
543
|
+
r_opts = rb_hash_new();
|
544
|
+
VALUE r_from = rb_hash_aref(r_opts, ID2SYM(rb_intern("from")));
|
545
|
+
if (NIL_P(r_from))
|
546
|
+
{
|
547
|
+
VALUE r_error_message = rb_str_new2("missing import source");
|
548
|
+
rb_exc_raise(rb_exc_new_str(rb_eRuntimeError, r_error_message));
|
549
|
+
return Qnil;
|
550
|
+
}
|
551
|
+
|
552
|
+
VMData *data;
|
553
|
+
TypedData_Get_Struct(r_self, VMData, &vm_type, data);
|
554
|
+
|
555
|
+
char *source = StringValueCStr(r_from);
|
556
|
+
char *import_name = StringValueCStr(r_import_string);
|
557
|
+
JSValue func = JS_Eval(data->context, source, strlen(source), "mmmodule", JS_EVAL_TYPE_MODULE | JS_EVAL_FLAG_COMPILE_ONLY);
|
558
|
+
js_module_set_import_meta(data->context, func, TRUE, FALSE);
|
559
|
+
JS_FreeValue(data->context, func);
|
560
|
+
|
561
|
+
const char *importAndGlobalizeModule = "import * as %s from 'mmmodule';\n"
|
562
|
+
"globalThis['%s'] = %s;\n";
|
563
|
+
int length = snprintf(NULL, 0, importAndGlobalizeModule, import_name, import_name, import_name);
|
564
|
+
char *result = (char *)malloc(length + 1);
|
565
|
+
snprintf(result, length + 1, importAndGlobalizeModule, import_name, import_name, import_name);
|
566
|
+
|
567
|
+
JSValue j_codeResult = JS_Eval(data->context, result, strlen(result), "<vm>", JS_EVAL_TYPE_MODULE);
|
568
|
+
free(result);
|
569
|
+
JS_FreeValue(data->context, j_codeResult);
|
570
|
+
|
571
|
+
return Qtrue;
|
572
|
+
}
|
573
|
+
|
574
|
+
static VALUE vm_m_getLogs(VALUE r_self)
|
575
|
+
{
|
576
|
+
VMData *data;
|
577
|
+
TypedData_Get_Struct(r_self, VMData, &vm_type, data);
|
578
|
+
|
579
|
+
return data->logs;
|
580
|
+
}
|
581
|
+
|
582
|
+
static VALUE pick_raw(VALUE block_arg, VALUE data, int argc, const VALUE *argv, VALUE blockarg)
|
583
|
+
{
|
584
|
+
return rb_hash_aref(block_arg, ID2SYM(rb_intern("raw")));
|
585
|
+
}
|
586
|
+
|
587
|
+
static VALUE vm_m_raw(VALUE r_self)
|
588
|
+
{
|
589
|
+
VALUE row = rb_iv_get(r_self, "@row");
|
590
|
+
VALUE r_ary = rb_block_call(row, rb_intern("map"), 0, NULL, pick_raw, Qnil);
|
591
|
+
|
592
|
+
return r_ary;
|
593
|
+
}
|
594
|
+
|
595
|
+
static VALUE pick_c(VALUE block_arg, VALUE data, int argc, const VALUE *argv, VALUE blockarg)
|
596
|
+
{
|
597
|
+
return rb_hash_aref(block_arg, ID2SYM(rb_intern("c")));
|
598
|
+
}
|
599
|
+
|
600
|
+
static VALUE vm_m_to_s(VALUE r_self)
|
601
|
+
{
|
602
|
+
VALUE row = rb_iv_get(r_self, "@row");
|
603
|
+
VALUE r_ary = rb_block_call(row, rb_intern("map"), 0, NULL, pick_c, Qnil);
|
604
|
+
|
605
|
+
return rb_funcall(r_ary, rb_intern("join"), 1, rb_str_new2(" "));
|
606
|
+
}
|
607
|
+
|
433
608
|
RUBY_FUNC_EXPORTED void
|
434
609
|
Init_quickjsrb(void)
|
435
610
|
{
|
436
|
-
rb_mQuickjs = rb_define_module("Quickjs");
|
611
|
+
VALUE rb_mQuickjs = rb_define_module("Quickjs");
|
437
612
|
rb_define_const(rb_mQuickjs, "MODULE_STD", ID2SYM(rb_intern(featureStdId)));
|
438
613
|
rb_define_const(rb_mQuickjs, "MODULE_OS", ID2SYM(rb_intern(featureOsId)));
|
439
614
|
rb_define_const(rb_mQuickjs, "FEATURES_TIMEOUT", ID2SYM(rb_intern(featureOsTimeoutId)));
|
440
615
|
|
441
|
-
VALUE
|
442
|
-
rb_define_const(
|
443
|
-
rb_define_const(
|
444
|
-
|
445
|
-
VALUE
|
446
|
-
rb_define_alloc_func(
|
447
|
-
rb_define_method(
|
448
|
-
rb_define_method(
|
449
|
-
rb_define_method(
|
616
|
+
VALUE rb_cQuickjsValue = rb_define_class_under(rb_mQuickjs, "Value", rb_cObject);
|
617
|
+
rb_define_const(rb_cQuickjsValue, "UNDEFINED", ID2SYM(rb_intern(undefinedId)));
|
618
|
+
rb_define_const(rb_cQuickjsValue, "NAN", ID2SYM(rb_intern(nanId)));
|
619
|
+
|
620
|
+
VALUE rb_cQuickjsVM = rb_define_class_under(rb_mQuickjs, "VM", rb_cObject);
|
621
|
+
rb_define_alloc_func(rb_cQuickjsVM, vm_alloc);
|
622
|
+
rb_define_method(rb_cQuickjsVM, "initialize", vm_m_initialize, -1);
|
623
|
+
rb_define_method(rb_cQuickjsVM, "eval_code", vm_m_evalCode, 1);
|
624
|
+
rb_define_method(rb_cQuickjsVM, "define_function", vm_m_defineGlobalFunction, 1);
|
625
|
+
rb_define_method(rb_cQuickjsVM, "import", vm_m_import, -1);
|
626
|
+
rb_define_method(rb_cQuickjsVM, "logs", vm_m_getLogs, 0);
|
627
|
+
|
628
|
+
rb_cQuickjsVMLog = rb_define_class_under(rb_cQuickjsVM, "Log", rb_cObject);
|
629
|
+
rb_define_attr(rb_cQuickjsVMLog, "severity", 1, 0);
|
630
|
+
rb_define_method(rb_cQuickjsVMLog, "raw", vm_m_raw, 0);
|
631
|
+
rb_define_method(rb_cQuickjsVMLog, "to_s", vm_m_to_s, 0);
|
632
|
+
rb_define_method(rb_cQuickjsVMLog, "inspect", vm_m_to_s, 0);
|
633
|
+
|
634
|
+
rb_cQuickjsRuntimeError = rb_define_class_under(rb_mQuickjs, "RuntimeError", rb_eRuntimeError);
|
635
|
+
|
636
|
+
rb_cQuickjsSyntaxError = rb_define_class_under(rb_mQuickjs, "SyntaxError", rb_cQuickjsRuntimeError);
|
637
|
+
rb_cQuickjsTypeError = rb_define_class_under(rb_mQuickjs, "TypeError", rb_cQuickjsRuntimeError);
|
638
|
+
rb_cQuickjsRangeError = rb_define_class_under(rb_mQuickjs, "RangeError", rb_cQuickjsRuntimeError);
|
639
|
+
rb_cQuickjsReferenceError = rb_define_class_under(rb_mQuickjs, "ReferenceError", rb_cQuickjsRuntimeError);
|
640
|
+
rb_cQuickjsURIError = rb_define_class_under(rb_mQuickjs, "URIError", rb_cQuickjsRuntimeError);
|
641
|
+
rb_cQuickjsEvalError = rb_define_class_under(rb_mQuickjs, "EvalError", rb_cQuickjsRuntimeError);
|
642
|
+
rb_cQuickjsAggregateError = rb_define_class_under(rb_mQuickjs, "AggregateError", rb_cQuickjsRuntimeError);
|
643
|
+
|
644
|
+
rb_cQuickjsInterruptedError = rb_define_class_under(rb_mQuickjs, "InterruptedError", rb_cQuickjsRuntimeError);
|
645
|
+
rb_cQuickjsNoAwaitError = rb_define_class_under(rb_mQuickjs, "NoAwaitError", rb_cQuickjsRuntimeError);
|
450
646
|
}
|
data/lib/quickjs/version.rb
CHANGED
data/lib/quickjs.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: quickjs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- hmsk
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-10-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|