Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Page
Library
Module
Module type
Parameter
Class
Class type
Source
c2f37ec, adopting its register-based regexp engine and latest memory-safety fixesRegExp.prepare_input and exec_prepared for reusing one matching buffer and UTF-16 map across repeated matchesAdvanceStringIndex helpersRegExp.exec returns match_result option: None on no match, and a record with captures, index, input, groups and indices on matchstring option array: a group that didn't participate in the match is None, like undefined in JavaScriptindex, last_index and set_last_index are UTF-16 code units (like JavaScript), not byte offsetsRegExp.compile rejects invalid flags (unknown, duplicated, or u with v) instead of ignoring them. Adds support for the d and v flagsString.Prototype.match_ and match_flags return RegExp.match_result option; match_all returns RegExp.match_result list; match_global accepts ?flagsString.Prototype regex-based methods raise Invalid_argument on invalid patterns instead of silently returning "no match"String.Prototype.split_regex returns string option array: a capture group that did not participate in the match splices None (JavaScript's undefined) instead of ""Global.parse_int auto-detects the radix like JavaScript (parse_int "0x10" is Some 16) and returns None for values that don't fit in an OCaml intGlobal.js_parse_options to Global.js_number_optionsquickjs.c and quickjs.bindings are wrapped: Libregexp, Atod, Dtoa, Cutils and Bindings become Quickjs_c.* and Quickjs_bindingsRegExp.last_index tracking: no more wrong values, overlapping matches or infinite loops when patterns have capture groupsRegExp.exec updating last_index on non-global, non-sticky regexpsError `Stack_overflowRegExp.flags reporting a u flag the user never passed for non-ASCII patterns$` in String.Prototype.replace_all/replace_regex_global: it now refers to the original stringString.Prototype.split_regex to match JavaScript on empty matches and empty inputString.Prototype.split_limit to coerce its limit with ToUint32 like JavaScript: negative limits wrap to huge values and behave as "no limit" (previously they returned [||])String.Prototype.slice/substring/substr raising Invalid_argument when their range splits a surrogate pair; the lone half becomes U+FFFD (JavaScript keeps the lone surrogate, which UTF-8 cannot represent)String.Prototype.trim/trim_start/trim_end to trim all JavaScript whitespace (was missing U+1680)String.Prototype.to_lower_case for the Greek final sigma: "ΑΣ" is "ας"String.Prototype.starts_with_from raising on huge positionsGlobal.parse_float_partial: it returned None for virtually every inputGlobal.parse_float "never" returning Some nan; unparsable input is always NoneNumber formatting options aborting the process: they raise Invalid_argumentGlobal.parse_float/parse_float_partial/parse_int skip leading whitespace like JavaScriptNumber.Prototype.to_fixed/to_precision/to_exponential use JavaScript's 0-100 digit rangesd flag, ES2022): match_result.indices carries the UTF-16 [start, end) range of every capture group (None without the flag, like JavaScript's hasIndices), plus group_indices for named groups, like JavaScript's match.indices.groups?timeout_ms to RegExp.exec/test to bound catastrophic backtracking (raises RegExp.Timeout)String.from_char_code and String.from_code_point, JavaScript's String.fromCharCode()/String.fromCodePoint(): ToUint16 coercion, surrogate-pair composition and the RangeError contract included; unpaired surrogates become U+FFFD since UTF-8 cannot represent themString.Prototype.split_regex_limit, JavaScript's split(regexp, limit): spliced capture groups count toward the limitString.utf16_index_of_byte/byte_index_of_utf16 to convert between byte offsets and UTF-16 indicesGlobal.parse_int_float: parseInt returning a float, exactly like JavaScript for values of any sizeUnicode.fold_case/fold_case_char: Unicode full case folding for caseless comparison, e.g. fold_case "Straße" = "strasse". Folds to a fixpoint, covering the capitals QuickJS's table folds one step short (fold_case "ẞ" is "ss", not "ß")Unicode.script, general_category and binary_property character-set lookups with the Unicode.CharSet module: the Unicode property tables behind JavaScript's \p{...} escapes, e.g. Unicode.script "Greek"Quickjs_c.Libunicode.char_range/char_range_free: raw bindings to libunicode's character range tables (unicode_script, unicode_general_category, unicode_prop)RegExp.lastIndex -> RegExp.last_indexRegExp.setLastIndex -> RegExp.set_last_indexuutfbellard/quickjs to quickjs-ng/quickjs - the actively maintained community fork with Unicode 17.0.0 support, better spec compliance, and ongoing developmentGlobal.parse_float for incomplete exponents ("1e", "1e+", "1e-") to return the parsed number instead of None, matching JavaScript spec. Workaround for quickjs-ng/quickjs#1259Breaking: Reorganized API to mirror JavaScript built-in objects for quickjs
Dtoa → Number.Prototype (toString, toFixed, toPrecision, toExponential, toRadix)Atod → Global (parse_float, parse_float_partial)IntToString → Number (of_int, of_int32, of_int64, of_int_radix, etc.)String.Prototype module (to_lower_case, to_upper_case, normalize)Unicode module for character-level operations (is_cased, is_id_start, canonicalize, etc.)RegExp.exec interface to return resultBug fix for RegExp backtracking when not find a match
Initial release of quickjs. This release only includes bindings to libregexp and exposes the API of the QuickJS C library with the same shape as the JavaScript API: RegExp.