@scriptc/cli-darwin-x64 0.2.2 → 0.2.3
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.
- package/dist/THIRD_PARTY_NOTICES +1 -1
- package/dist/bin/scriptc +0 -0
- package/dist/bin/scriptc.json +1 -1
- package/dist/lib/declarations/scriptc-node-fallback.d.ts +99 -27
- package/dist/lib/llvm/bin/scriptc-llvm-codegen +0 -0
- package/dist/lib/llvm/package.json +1 -1
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_array.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_assert.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_async.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_bytes_io.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_events.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_exception.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_file_handle.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_json.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_lib.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_map.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_node_builtin.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_regex.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_symbol.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_url.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_url_params.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_util_compare.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/default/scr_util_style.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_array.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_assert.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_async.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_bytes_io.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_events.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_exception.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_file_handle.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_island.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_json.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_lib.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_map.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_node_builtin.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_regex.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_symbol.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_url.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_url_params.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_util_compare.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_util_style.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/dev/runtime/dynamic/scr_web.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-dev/runtime/default/scr_array.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-dev/runtime/default/scr_assert.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-dev/runtime/default/scr_bytes_io.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-dev/runtime/default/scr_exception.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-dev/runtime/default/scr_json.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-dev/runtime/default/scr_lib.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-dev/runtime/default/scr_map.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-dev/runtime/default/scr_node_builtin.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-dev/runtime/default/scr_regex.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-dev/runtime/default/scr_symbol.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-dev/runtime/default/scr_url.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-dev/runtime/default/scr_url_params.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-release/runtime/default/scr_array.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-release/runtime/default/scr_assert.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-release/runtime/default/scr_bytes_io.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-release/runtime/default/scr_exception.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-release/runtime/default/scr_json.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-release/runtime/default/scr_lib.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-release/runtime/default/scr_map.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-release/runtime/default/scr_node_builtin.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-release/runtime/default/scr_regex.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-release/runtime/default/scr_symbol.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-release/runtime/default/scr_url.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-release/runtime/default/scr_url_params.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-dev/runtime/default/scr_array.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-dev/runtime/default/scr_assert.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-dev/runtime/default/scr_bytes_io.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-dev/runtime/default/scr_exception.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-dev/runtime/default/scr_json.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-dev/runtime/default/scr_lib.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-dev/runtime/default/scr_map.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-dev/runtime/default/scr_node_builtin.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-dev/runtime/default/scr_regex.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-dev/runtime/default/scr_symbol.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-dev/runtime/default/scr_url.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-dev/runtime/default/scr_url_params.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-release/runtime/default/scr_array.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-release/runtime/default/scr_assert.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-release/runtime/default/scr_bytes_io.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-release/runtime/default/scr_exception.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-release/runtime/default/scr_json.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-release/runtime/default/scr_lib.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-release/runtime/default/scr_map.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-release/runtime/default/scr_node_builtin.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-release/runtime/default/scr_regex.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-release/runtime/default/scr_symbol.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-release/runtime/default/scr_url.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/library-thread-release/runtime/default/scr_url_params.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_array.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_assert.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_async.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_bytes_io.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_events.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_exception.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_file_handle.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_json.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_lib.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_map.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_node_builtin.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_regex.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_symbol.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_url.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_url_params.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_util_compare.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/default/scr_util_style.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_array.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_assert.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_async.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_bytes_io.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_events.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_exception.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_file_handle.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_island.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_json.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_lib.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_map.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_node_builtin.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_regex.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_symbol.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_url.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_url_params.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_util_compare.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_util_style.o +0 -0
- package/dist/lib/runtime-darwin-x64/artifacts/release/runtime/dynamic/scr_web.o +0 -0
- package/dist/lib/runtime-darwin-x64/package.json +1 -1
- package/dist/lib/runtime-darwin-x64/runtime-pack.json +351 -225
- package/dist/lib/runtime-sources/package.json +1 -1
- package/dist/lib/runtime-sources/src/scr_array.c +5 -0
- package/dist/lib/runtime-sources/src/scr_assert.c +26 -0
- package/dist/lib/runtime-sources/src/scr_async.c +44 -0
- package/dist/lib/runtime-sources/src/scr_bytes_io.c +305 -48
- package/dist/lib/runtime-sources/src/scr_events.c +9 -0
- package/dist/lib/runtime-sources/src/scr_exception.c +1 -0
- package/dist/lib/runtime-sources/src/scr_file_handle.c +11 -0
- package/dist/lib/runtime-sources/src/scr_island.c +1001 -417
- package/dist/lib/runtime-sources/src/scr_island_manifest.h +11 -7
- package/dist/lib/runtime-sources/src/scr_json.c +135 -2
- package/dist/lib/runtime-sources/src/scr_lib.c +379 -12
- package/dist/lib/runtime-sources/src/scr_map.c +8 -0
- package/dist/lib/runtime-sources/src/scr_node_builtin.c +78 -0
- package/dist/lib/runtime-sources/src/scr_regex.c +65 -0
- package/dist/lib/runtime-sources/src/scr_runtime.h +69 -1
- package/dist/lib/runtime-sources/src/scr_symbol.c +5 -0
- package/dist/lib/runtime-sources/src/scr_system_errors.h +573 -0
- package/dist/lib/runtime-sources/src/scr_url.c +515 -59
- package/dist/lib/runtime-sources/src/scr_url_internal.h +6 -0
- package/dist/lib/runtime-sources/src/scr_url_params.c +10 -0
- package/dist/lib/runtime-sources/src/scr_util_compare.c +222 -0
- package/dist/lib/runtime-sources/src/scr_util_style.c +337 -0
- package/dist/lib/runtime-sources/src/scr_web.c +720 -238
- package/package.json +1 -1
|
@@ -719,6 +719,60 @@ ScrStr *scr_regex_replace(ScrStr *s, ScrRegex *re, ScrStr *rep) {
|
|
|
719
719
|
return scr_replace_impl(s, re, rep);
|
|
720
720
|
}
|
|
721
721
|
|
|
722
|
+
|
|
723
|
+
/* The pinned Node ANSI matcher derives from ansi-regex, copyright (c)
|
|
724
|
+
* Sindre Sorhus <sindresorhus@gmail.com>, used under the MIT license:
|
|
725
|
+
* Permission is hereby granted, free of charge, to any person obtaining a
|
|
726
|
+
* copy of this software and associated documentation files (the "Software"),
|
|
727
|
+
* to deal in the Software without restriction, including without limitation
|
|
728
|
+
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
729
|
+
* and/or sell copies of the Software, and to permit persons to whom the
|
|
730
|
+
* Software is furnished to do so, subject to the following conditions:
|
|
731
|
+
* The above copyright notice and this permission notice shall be included
|
|
732
|
+
* in all copies or substantial portions of the Software.
|
|
733
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
734
|
+
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
735
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
736
|
+
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
737
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
738
|
+
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
739
|
+
* DEALINGS IN THE SOFTWARE.
|
|
740
|
+
* Keep the pattern equivalent to Node v24.15.0 internal/util/inspect.js. */
|
|
741
|
+
#define SCR_VT_PATTERN "[\\u001B\\u009B][[\\]()#;?]*" \
|
|
742
|
+
"(?:(?:(?:(?:;[-a-zA-Z\\d\\/\\#&.:=?%@~_]+)*" \
|
|
743
|
+
"|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/\\#&.:=?%@~_]*)*)?" \
|
|
744
|
+
"(?:\\u0007|\\u001B\\u005C|\\u009C))" \
|
|
745
|
+
"|(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"
|
|
746
|
+
|
|
747
|
+
ScrStr *scr_util_strip_vt(const ScrDyn *input) {
|
|
748
|
+
if (!input || input->kind != SCR_DYN_STR) {
|
|
749
|
+
scr_dyn_arg_type_fail("str", "of type string", input ? input : scr_dyn_undefined());
|
|
750
|
+
return NULL;
|
|
751
|
+
}
|
|
752
|
+
ScrStr *subject = input->v.str;
|
|
753
|
+
bool escape = false;
|
|
754
|
+
for (size_t i = 0; i < subject->len; i++) {
|
|
755
|
+
if (subject->data[i] == '\x1b' || ((unsigned char)subject->data[i] == 0xc2 &&
|
|
756
|
+
i + 1 < subject->len && (unsigned char)subject->data[i + 1] == 0x9b)) {
|
|
757
|
+
escape = true;
|
|
758
|
+
break;
|
|
759
|
+
}
|
|
760
|
+
}
|
|
761
|
+
if (!escape) return scr_str_retain(subject);
|
|
762
|
+
static const struct { size_t rc, len, cap; char data[sizeof SCR_VT_PATTERN]; }
|
|
763
|
+
source = { SIZE_MAX, sizeof SCR_VT_PATTERN - 1, sizeof SCR_VT_PATTERN - 1, SCR_VT_PATTERN };
|
|
764
|
+
static const struct { size_t rc, len, cap; char data[2]; }
|
|
765
|
+
flags = { SIZE_MAX, 1, 1, "g" };
|
|
766
|
+
static SCR_TL ScrRegex template = { SIZE_MAX, (ScrStr *)&source, (ScrStr *)&flags, NULL, 0, NULL };
|
|
767
|
+
ScrRegex *regex = scr_regex_literal(&template);
|
|
768
|
+
ScrStr *empty = scr_str_new("", 0);
|
|
769
|
+
ScrStr *result = scr_regex_replace(subject, regex, empty);
|
|
770
|
+
scr_str_release(empty);
|
|
771
|
+
scr_regex_release(regex);
|
|
772
|
+
return result;
|
|
773
|
+
}
|
|
774
|
+
#undef SCR_VT_PATTERN
|
|
775
|
+
|
|
722
776
|
ScrStr *scr_regex_replace_all(ScrStr *s, ScrRegex *re, ScrStr *rep) {
|
|
723
777
|
if (!(lre_get_flags(scr_regex_bc(re)) & LRE_FLAG_GLOBAL)) {
|
|
724
778
|
/* Node's exact TypeError — a real instance now: catch bindings narrow
|
|
@@ -1058,6 +1112,17 @@ bool scr_assert_regex_err_test(ScrRegex *re, ScrError *err) {
|
|
|
1058
1112
|
return matched;
|
|
1059
1113
|
}
|
|
1060
1114
|
|
|
1115
|
+
bool scr_assert_regex_dyn_test(ScrRegex *re, ScrDyn *actual) {
|
|
1116
|
+
// String(symbol) accepts a direct Symbol; object conversion uses the
|
|
1117
|
+
// string hint, including Symbol.toPrimitive and custom Error formatters.
|
|
1118
|
+
ScrStr *str = actual->kind == SCR_DYN_SYMBOL
|
|
1119
|
+
? scr_dyn_string_constructor(actual) : scr_util_to_usv_string(actual);
|
|
1120
|
+
if (!str) return false;
|
|
1121
|
+
bool matched = scr_assert_regex_hits(re, str);
|
|
1122
|
+
scr_str_release(str);
|
|
1123
|
+
return matched;
|
|
1124
|
+
}
|
|
1125
|
+
|
|
1061
1126
|
/* The regex-valued shape slot (assert.throws(fn, {message: /re/})):
|
|
1062
1127
|
* test the stashed actual key eagerly and store verdict + rendering, so
|
|
1063
1128
|
* scr_assert.c's comparison and diff stay libregexp-free. An absent
|
|
@@ -818,6 +818,11 @@ ScrStr *scr_str_pad_end(ScrStr *s, double maxLength, ScrStr *fill);
|
|
|
818
818
|
* both are no-ops on well-formed input). Borrow s; toWellFormed +1. */
|
|
819
819
|
bool scr_str_is_well_formed(ScrStr *s);
|
|
820
820
|
ScrStr *scr_str_to_well_formed(ScrStr *s);
|
|
821
|
+
/* Node text utilities: borrowed input, +1 result or NULL+pending. The VT
|
|
822
|
+
* helper lives in the optional regex unit; USV conversion uses native strings. */
|
|
823
|
+
ScrStr *scr_util_strip_vt(const struct ScrDyn *input);
|
|
824
|
+
ScrStr *scr_util_to_usv_string(const struct ScrDyn *input);
|
|
825
|
+
void scr_dyn_install_to_primitive_symbol(struct ScrDyn *key);
|
|
821
826
|
|
|
822
827
|
/* RegExp.escape(s) — ES2025 EncodeForRegExpEscape per code point: leading
|
|
823
828
|
* ASCII alphanumeric hex-escapes, SyntaxCharacters and '/' take a
|
|
@@ -911,11 +916,22 @@ void scr_qs_parse_into(ScrMap *out, const ScrStr *qs, const ScrStr *sep,
|
|
|
911
916
|
* a fresh ParsedResults object whose `values` child has null prototype.
|
|
912
917
|
* Borrows config; returns +1, or NULL with a Node-coded TypeError pending. */
|
|
913
918
|
struct ScrDyn *scr_util_parse_args(const struct ScrDyn *config);
|
|
919
|
+
ScrStr *scr_util_style_text(const struct ScrDyn *format, const struct ScrDyn *text, const struct ScrDyn *options);
|
|
920
|
+
|
|
921
|
+
/* Node/libuv system error utilities. Arguments are checked without coercion;
|
|
922
|
+
* entries is a fresh array of [number, [name, message]] pairs (+1). */
|
|
923
|
+
ScrStr *scr_util_system_error_name(const struct ScrDyn *error);
|
|
924
|
+
ScrStr *scr_util_system_error_message(const struct ScrDyn *error);
|
|
925
|
+
struct ScrDyn *scr_util_system_error_entries(void);
|
|
914
926
|
|
|
915
927
|
/* Node 24's dotenv grammar, shared by util.parseEnv and process.loadEnvFile.
|
|
916
928
|
* Arguments are borrowed; parseEnv returns a fresh ordinary object (+1).
|
|
917
929
|
* Validation and file failures leave a coded exception pending. */
|
|
918
930
|
struct ScrDyn *scr_util_parse_env(const struct ScrDyn *content);
|
|
931
|
+
/* Checked primitives, ordinary records/arrays and byte views. Opaque native
|
|
932
|
+
* objects and accessor descriptors retain explicit catchable refusals. */
|
|
933
|
+
bool scr_util_is_deep_strict_equal(const struct ScrDyn *a, const struct ScrDyn *b,
|
|
934
|
+
const struct ScrDyn *skip_prototype);
|
|
919
935
|
void scr_process_load_env_file(const struct ScrDyn *path);
|
|
920
936
|
|
|
921
937
|
/* querystring.stringify — Node's stringify over a borrowed dyn value (the
|
|
@@ -1119,6 +1135,10 @@ double scr_arr_get_number(const ScrArr *a, double i);
|
|
|
1119
1135
|
bool scr_arr_index_eq(const ScrArr *a, double i, const ScrArr *b, double j);
|
|
1120
1136
|
bool scr_arr_get_bool(ScrArr *a, double i); /* trap missing/hole */
|
|
1121
1137
|
void *scr_arr_get_ref(ScrArr *a, double i); /* trap missing/hole; +1 */
|
|
1138
|
+
/* Borrow a non-null reference element, or NULL for a hole/undefined/missing
|
|
1139
|
+
* property. Keep the array alive and retain before removing its element.
|
|
1140
|
+
* This read does not invoke retain callbacks or mutate runtime state. */
|
|
1141
|
+
void *scr_arr_peek_ref(const ScrArr *a, double i);
|
|
1122
1142
|
|
|
1123
1143
|
/* i == len appends; the _ref variant releases the old element (when
|
|
1124
1144
|
* replacing) and takes ownership of the new one. */
|
|
@@ -1466,6 +1486,7 @@ void scr_set_add_all(ScrMap *set, ScrArr *values);
|
|
|
1466
1486
|
ScrArr *scr_set_to_arr_f64(const ScrMap *s);
|
|
1467
1487
|
ScrArr *scr_set_to_arr_str(const ScrMap *s);
|
|
1468
1488
|
ScrArr *scr_set_to_arr_ref(const ScrMap *s);
|
|
1489
|
+
ScrArr *scr_set_to_arr_dyn(const ScrMap *s);
|
|
1469
1490
|
|
|
1470
1491
|
/* REF-element Set construction: a set-shaped map whose keys are refcounted
|
|
1471
1492
|
* pointers under identity hashing (see SCR_MAP_KEY_REF above). The element
|
|
@@ -2615,7 +2636,29 @@ void scr_fs_fchmod(double fd, double mode);
|
|
|
2615
2636
|
void scr_fs_fsync(double fd);
|
|
2616
2637
|
void scr_fs_fdatasync(double fd);
|
|
2617
2638
|
void scr_fs_ftruncate(double fd, double length);
|
|
2639
|
+
void scr_fs_utimes(ScrStr *path, double atime, double mtime, bool nofollow);
|
|
2640
|
+
void scr_fs_invalid_path(const ScrDyn *value, const ScrStr *path);
|
|
2641
|
+
void scr_fs_invalid_named_path(const ScrDyn *value, const ScrStr *path, const char *name);
|
|
2642
|
+
void scr_fs_futimes(double fd, double atime, double mtime);
|
|
2618
2643
|
void scr_fs_link(ScrStr *source, ScrStr *dest);
|
|
2644
|
+
void scr_fs_symlink(ScrStr *target, ScrStr *destination, int kind);
|
|
2645
|
+
int scr_fs_symlink_infer(ScrStr *absolute);
|
|
2646
|
+
ScrBytes *scr_fs_readlink_bytes(ScrStr *path);
|
|
2647
|
+
void scr_fs_link_checked(const ScrDyn *existing, const ScrDyn *destination);
|
|
2648
|
+
void scr_fs_symlink_checked(const ScrDyn *target, const ScrDyn *destination, const ScrDyn *type);
|
|
2649
|
+
void scr_fs_symlink_promise_checked(const ScrDyn *target, const ScrDyn *destination, const ScrDyn *type);
|
|
2650
|
+
ScrDyn *scr_fs_readlink_checked(const ScrDyn *path, const ScrDyn *options, bool promise);
|
|
2651
|
+
ScrDyn *scr_fs_readlink_dyn(const ScrDyn *path, const ScrDyn *options);
|
|
2652
|
+
ScrDyn *scr_fs_statfs(ScrStr *path, bool bigint);
|
|
2653
|
+
ScrDyn *scr_fs_statfs_checked(const ScrDyn *path, const ScrDyn *options);
|
|
2654
|
+
ScrPromise *scr_fsp_statfs(const ScrDyn *path, const ScrDyn *options);
|
|
2655
|
+
ScrStr *scr_fs_readlink_str(const ScrDyn *path, const ScrDyn *options);
|
|
2656
|
+
ScrBytes *scr_fs_readlink_buffer(const ScrDyn *path, const ScrDyn *options);
|
|
2657
|
+
ScrPromise *scr_fsp_link(const ScrDyn *existing, const ScrDyn *destination);
|
|
2658
|
+
ScrPromise *scr_fsp_symlink(const ScrDyn *target, const ScrDyn *destination, const ScrDyn *type);
|
|
2659
|
+
ScrPromise *scr_fsp_readlink_dyn(const ScrDyn *path, const ScrDyn *options);
|
|
2660
|
+
ScrPromise *scr_fsp_readlink_str(const ScrDyn *path, const ScrDyn *options);
|
|
2661
|
+
ScrPromise *scr_fsp_readlink_buffer(const ScrDyn *path, const ScrDyn *options);
|
|
2619
2662
|
ScrStats *scr_stats_retain(ScrStats *s);
|
|
2620
2663
|
void scr_stats_release(ScrStats *s);
|
|
2621
2664
|
void *scr_stats_retain_v(void *p);
|
|
@@ -2647,6 +2690,8 @@ ScrPromise *scr_fsp_mkdir_recursive(ScrStr *path);
|
|
|
2647
2690
|
ScrPromise *scr_fsp_mkdir_recursive_mode(ScrStr *path, double mode);
|
|
2648
2691
|
ScrPromise *scr_fsp_unlink(ScrStr *path);
|
|
2649
2692
|
ScrPromise *scr_fsp_chmod(ScrStr *path, double mode);
|
|
2693
|
+
ScrPromise *scr_fsp_utimes(const ScrDyn *path, const ScrDyn *atime, const ScrDyn *mtime);
|
|
2694
|
+
ScrPromise *scr_fsp_lutimes(const ScrDyn *path, const ScrDyn *atime, const ScrDyn *mtime);
|
|
2650
2695
|
ScrPromise *scr_fsp_readdir(ScrStr *path);
|
|
2651
2696
|
ScrPromise *scr_fsp_rm(ScrStr *path);
|
|
2652
2697
|
ScrPromise *scr_fsp_stat(ScrStr *path);
|
|
@@ -2655,6 +2700,7 @@ ScrPromise *scr_fsp_lstat(ScrStr *path);
|
|
|
2655
2700
|
ScrPromise *scr_fsp_rename(ScrStr *oldpath, ScrStr *newpath);
|
|
2656
2701
|
ScrPromise *scr_fsp_open(ScrStr *path, ScrStr *flags, double mode);
|
|
2657
2702
|
ScrPromise *scr_file_handle_close_promise(ScrFileHandle *h);
|
|
2703
|
+
ScrPromise *scr_file_handle_utimes_promise(ScrFileHandle *h, const ScrDyn *atime, const ScrDyn *mtime);
|
|
2658
2704
|
ScrPromise *scr_file_handle_read_file_promise(ScrFileHandle *h, ScrStr *encoding);
|
|
2659
2705
|
ScrPromise *scr_file_handle_read_file_bytes_promise(ScrFileHandle *h, ScrStr *encoding);
|
|
2660
2706
|
ScrPromise *scr_file_handle_write_file_promise(ScrFileHandle *h, ScrStr *data, ScrStr *encoding);
|
|
@@ -3203,7 +3249,7 @@ double scr_fs_read_zero(double fd, double position);
|
|
|
3203
3249
|
void scr_fs_close(double fd);
|
|
3204
3250
|
|
|
3205
3251
|
/* ── WHATWG URL (scr_url.c) ──────────────────────────────────────────
|
|
3206
|
-
*
|
|
3252
|
+
* A mutable, refcounted URL value with selected component setters. The
|
|
3207
3253
|
* parser covers the WHATWG algorithm's common ground exactly (see
|
|
3208
3254
|
* scr_url.c's header comment for the covered surface and the documented
|
|
3209
3255
|
* divergences: no IDNA, no IPv6, opaque paths verbatim).
|
|
@@ -3235,6 +3281,9 @@ ScrStr *scr_url_hostname(ScrUrl *u); /* +1 port-less host ("" when none) */
|
|
|
3235
3281
|
ScrStr *scr_url_port(ScrUrl *u); /* +1 "" or normalized non-default port */
|
|
3236
3282
|
ScrStr *scr_url_pathname(ScrUrl *u); /* +1 */
|
|
3237
3283
|
ScrStr *scr_url_href(ScrUrl *u); /* +1; also toString() */
|
|
3284
|
+
void scr_url_set(ScrUrl *u, ScrStr *field, ScrStr *value); /* borrowed; href may throw */
|
|
3285
|
+
bool scr_url_set_component(ScrUrl *u, ScrStr *field, ScrStr *value); /* borrowed; false for ignored writes */
|
|
3286
|
+
void scr_url_set_checked(ScrUrl *u, ScrStr *field, const ScrDyn *value); /* borrowed; conversion may throw */
|
|
3238
3287
|
ScrStr *scr_url_to_path(ScrUrl *u); /* +1, or throws */
|
|
3239
3288
|
ScrStr *scr_url_str_to_path(ScrStr *s); /* +1, or throws */
|
|
3240
3289
|
ScrUrl *scr_url_from_path(ScrStr *path); /* +1; throws on win32 UNC malformations only */
|
|
@@ -3928,6 +3977,8 @@ ScrBytes *scr_dyn_bytes_unbox(const ScrDyn *d);
|
|
|
3928
3977
|
/* Exact numeric typed-array brand; elem is a ScrBytesElem tag. */
|
|
3929
3978
|
bool scr_dyn_bytes_is(const ScrDyn *d, int elem);
|
|
3930
3979
|
bool scr_dyn_typed_array_is(const ScrDyn *d, int elem);
|
|
3980
|
+
bool scr_dyn_util_type_is(const ScrDyn *value, const ScrStr *probe);
|
|
3981
|
+
ScrDyn *scr_dyn_util_type_value(const ScrDyn *value, const ScrStr *probe);
|
|
3931
3982
|
void scr_dyn_arr_push(ScrDyn *arr, ScrDyn *item);
|
|
3932
3983
|
/* Spread completion for a runtime-arity argument list (`f(...xs)` in the
|
|
3933
3984
|
* checked-dynamic tier): flattens `src` into `arr` per JS's spread over the
|
|
@@ -4133,6 +4184,9 @@ ScrMap *scr_dyn_native_map_check(const ScrDyn *value, const ScrDynPath *path);
|
|
|
4133
4184
|
bool scr_dyn_native_collection_is(const ScrDyn *value, int map, const char *type);
|
|
4134
4185
|
ScrMap *scr_dyn_native_collection_check(const ScrDyn *value, int map, const char *type, const ScrDynPath *path);
|
|
4135
4186
|
ScrStr *scr_url_checked_to_path(const ScrDyn *value);
|
|
4187
|
+
ScrStr *scr_url_checked_to_path_options(const ScrDyn *value, const ScrDyn *options);
|
|
4188
|
+
ScrBytes *scr_url_checked_to_path_buffer(const ScrDyn *value, const ScrDyn *options);
|
|
4189
|
+
ScrUrl *scr_url_checked_from_path(const ScrDyn *value, const ScrDyn *options);
|
|
4136
4190
|
ScrUrl *scr_dyn_native_url_check(const ScrDyn *value, const ScrDynPath *path);
|
|
4137
4191
|
ScrRegex *scr_dyn_native_regex_check(const ScrDyn *value, const ScrDynPath *path);
|
|
4138
4192
|
ScrClassObj *scr_dyn_class_check(const ScrDyn *value, const char *type_key, const ScrDynPath *path);
|
|
@@ -4194,6 +4248,8 @@ ScrDyn *scr_global_native(ScrArr *known);
|
|
|
4194
4248
|
ScrDyn *scr_global_native_init(ScrArr *known, ScrDyn *(*console_get)(void));
|
|
4195
4249
|
ScrDyn *scr_console_native(void);
|
|
4196
4250
|
ScrDyn *scr_process_stdio(double fd);
|
|
4251
|
+
bool scr_dyn_process_stdio_is(const ScrDyn *value);
|
|
4252
|
+
double scr_dyn_process_stdio_fd(const ScrDyn *value, const ScrDynPath *path);
|
|
4197
4253
|
|
|
4198
4254
|
void scr_dyn_handle_install(ScrDynHandleTag tag, const ScrDynHandleOps *ops);
|
|
4199
4255
|
void scr_file_handle_dyn_install(void);
|
|
@@ -4298,6 +4354,7 @@ typedef struct ScrDynJsvalOps {
|
|
|
4298
4354
|
ScrDyn *(*iter_drain)(ScrJsval *cell, bool spread, const ScrStr *spell);
|
|
4299
4355
|
ScrDyn *(*iterator)(ScrJsval *cell, const ScrStr *spell, bool array_from);
|
|
4300
4356
|
ScrDyn *(*iter_n)(ScrJsval *cell, double count);
|
|
4357
|
+
bool (*type_probe)(ScrJsval *cell, const ScrStr *probe); /* internal brand; no property access */
|
|
4301
4358
|
} ScrDynJsvalOps;
|
|
4302
4359
|
|
|
4303
4360
|
/* The allocator view the gated constructor uses (installs the ops);
|
|
@@ -5151,6 +5208,8 @@ typedef struct ScrIslandEdge {
|
|
|
5151
5208
|
* after scr_lib_init. */
|
|
5152
5209
|
void scr_island_modules(const ScrIslandModule *mods, size_t nmods,
|
|
5153
5210
|
const ScrIslandEdge *edges, size_t nedges);
|
|
5211
|
+
/* The logical source entry, independent of the installed binary path. */
|
|
5212
|
+
void scr_island_entry_module(const char *filename);
|
|
5154
5213
|
|
|
5155
5214
|
/* The inflater for compressed embedded module text (raw DEFLATE, exact
|
|
5156
5215
|
* inflated size known from the table row). The emitted main installs
|
|
@@ -5950,6 +6009,10 @@ ScrBytes *scr_buffer_new_string_fail(const ScrDyn *got);
|
|
|
5950
6009
|
* numbers coerce (negatives answer now/1000), the rest throw Node's
|
|
5951
6010
|
* ERR_INVALID_ARG_TYPE. Borrowed. */
|
|
5952
6011
|
double scr_fs_to_unix_timestamp(const ScrDyn *t);
|
|
6012
|
+
double scr_fs_timestamp_value(const ScrDyn *t, const char *name);
|
|
6013
|
+
void scr_fs_utimes_checked(const ScrDyn *path, const ScrDyn *atime, const ScrDyn *mtime);
|
|
6014
|
+
void scr_fs_lutimes_checked(const ScrDyn *path, const ScrDyn *atime, const ScrDyn *mtime);
|
|
6015
|
+
void scr_fs_futimes_checked(const ScrDyn *fd, const ScrDyn *atime, const ScrDyn *mtime);
|
|
5953
6016
|
/* The fs argument-validation ladders (the fs.*Chk libCalls): Node-order
|
|
5954
6017
|
* validation over dyn values with Node's exact typed errors; a pass
|
|
5955
6018
|
* meets the real operation where one exists (mkdtempSync, macOS
|
|
@@ -7364,6 +7427,11 @@ void scr_assert_shape_end(ScrStr *msg, bool has_msg);
|
|
|
7364
7427
|
/* assert.doesNotReject whose rejection MATCHED (or had no expected):
|
|
7365
7428
|
* "Got unwanted rejection[: message].\nActual message: \"...\"". */
|
|
7366
7429
|
void scr_assert_unwanted_rejection(ScrError *err, ScrStr *msg, bool has_msg);
|
|
7430
|
+
/* No-error assertions share Node's unwanted-exception/rejection message.
|
|
7431
|
+
* The frontend reads and coerces actual?.message, preserving getter throws. */
|
|
7432
|
+
void scr_assert_unwanted_error(ScrStr *actual_message, bool rejection, ScrStr *msg, bool has_msg);
|
|
7433
|
+
bool scr_assert_no_error_predicate(ScrDyn *predicate, ScrDyn *actual);
|
|
7434
|
+
bool scr_assert_regex_dyn_test(ScrRegex *re, ScrDyn *actual);
|
|
7367
7435
|
/* assert.ifError over the static surface: throws for ANY value the
|
|
7368
7436
|
* frontend routes here (Node: everything but null/undefined, falsy
|
|
7369
7437
|
* included) — "ifError got unwanted exception: " + the error's message
|
|
@@ -90,6 +90,11 @@ ScrSym *scr_sym_well_known(ScrStr *name) {
|
|
|
90
90
|
scr_dyn_install_async_iterator_symbol(key);
|
|
91
91
|
scr_dyn_release(key);
|
|
92
92
|
}
|
|
93
|
+
if (name->len == 11 && !memcmp(name->data, "toPrimitive", 11)) {
|
|
94
|
+
ScrDyn *key = scr_dyn_new_symbol(symbol);
|
|
95
|
+
scr_dyn_install_to_primitive_symbol(key);
|
|
96
|
+
scr_dyn_release(key);
|
|
97
|
+
}
|
|
93
98
|
return symbol;
|
|
94
99
|
}
|
|
95
100
|
|