package quickjs
Bindings for QuickJS (a Javascript Engine to be embedded https://bellard.org/quickjs)
Install
dune-project
Dependency
Authors
Maintainers
Sources
quickjs-0.6.0.tbz
sha256=24e60ef65737c2b8e762b98fbdbc836380425c35c5b3ffae657a14671e51d959
sha512=3868ca89255ebc03ea8a9ba6fe1604c8c5aad5060274d518be99a3300883ebeae864b8b68bf3782875c527a41828f40b3cb75d50179d6802ec0eafd59591af4f
doc/CHANGES.html
Changes
Unreleased
0.6.0
- Update QuickJS-NG to
c2f37ec, adopting its register-based regexp engine and latest memory-safety fixes - Add regexp modifiers, duplicate named capture groups, full Unicode sets, and Unicode properties of strings
0.5.1
- Add
RegExp.prepare_inputandexec_preparedfor reusing one matching buffer and UTF-16 map across repeated matches - Add prepared-input source range, substring and
AdvanceStringIndexhelpers - Fix regexp captures whose UTF-16 range splits a surrogate pair: the unpaired half is represented as U+FFFD instead of slicing the wrong UTF-8 bytes
- Fix Unicode global and sticky regexps starting from the trailing half of a surrogate pair instead of the pair's start
0.5.0
- Breaking:
RegExp.execreturnsmatch_result option:Noneon no match, and a record withcaptures,index,input,groupsandindiceson match - Breaking: RegExp captures are
string option array: a group that didn't participate in the match isNone, likeundefinedin JavaScript - Breaking: RegExp's
index,last_indexandset_last_indexare UTF-16 code units (like JavaScript), not byte offsets - Breaking:
RegExp.compilerejects invalid flags (unknown, duplicated, oruwithv) instead of ignoring them. Adds support for thedandvflags - Breaking:
String.Prototype.match_andmatch_flagsreturnRegExp.match_result option;match_allreturnsRegExp.match_result list;match_globalaccepts?flags - Breaking:
String.Prototyperegex-based methods raiseInvalid_argumenton invalid patterns instead of silently returning "no match" - Breaking:
String.Prototype.split_regexreturnsstring option array: a capture group that did not participate in the match splicesNone(JavaScript'sundefined) instead of"" - Breaking:
Global.parse_intauto-detects the radix like JavaScript (parse_int "0x10"isSome 16) and returnsNonefor values that don't fit in an OCamlint - Breaking: rename
Global.js_parse_optionstoGlobal.js_number_options - Breaking:
quickjs.candquickjs.bindingsare wrapped:Libregexp,Atod,Dtoa,CutilsandBindingsbecomeQuickjs_c.*andQuickjs_bindings - Fix
RegExp.last_indextracking: no more wrong values, overlapping matches or infinite loops when patterns have capture groups - Fix
RegExp.execupdatinglast_indexon non-global, non-sticky regexps - Fix memory leaks: compiled regexps and character classes no longer leak
- Fix crash when regexp patterns are nested too deeply: returns
Error `Stack_overflow - Fix
RegExp.flagsreporting auflag the user never passed for non-ASCII patterns - Fix
$`inString.Prototype.replace_all/replace_regex_global: it now refers to the original string - Fix
String.Prototype.split_regexto match JavaScript on empty matches and empty input - Fix
String.Prototype.split_limitto coerce its limit with ToUint32 like JavaScript: negative limits wrap to huge values and behave as "no limit" (previously they returned[||]) - Fix
String.Prototype.slice/substring/substrraisingInvalid_argumentwhen their range splits a surrogate pair; the lone half becomes U+FFFD (JavaScript keeps the lone surrogate, which UTF-8 cannot represent) - Fix
String.Prototype.trim/trim_start/trim_endto trim all JavaScript whitespace (was missing U+1680) - Fix
String.Prototype.to_lower_casefor the Greek final sigma:"ΑΣ"is"ας" - Fix
String.Prototype.starts_with_fromraising on huge positions - Fix
Global.parse_float_partial: it returnedNonefor virtually every input - Fix
Global.parse_float "never"returningSome nan; unparsable input is alwaysNone - Fix invalid
Numberformatting options aborting the process: they raiseInvalid_argument Global.parse_float/parse_float_partial/parse_intskip leading whitespace like JavaScriptNumber.Prototype.to_fixed/to_precision/to_exponentialuse JavaScript's 0-100 digit ranges- Add RegExp match indices (the
dflag, ES2022):match_result.indicescarries the UTF-16[start, end)range of every capture group (Nonewithout the flag, like JavaScript'shasIndices), plusgroup_indicesfor named groups, like JavaScript'smatch.indices.groups - Add
?timeout_mstoRegExp.exec/testto bound catastrophic backtracking (raisesRegExp.Timeout) - Add
String.from_char_codeandString.from_code_point, JavaScript'sString.fromCharCode()/String.fromCodePoint(): ToUint16 coercion, surrogate-pair composition and the RangeError contract included; unpaired surrogates become U+FFFD since UTF-8 cannot represent them - Add
String.Prototype.split_regex_limit, JavaScript'ssplit(regexp, limit): spliced capture groups count toward the limit - Add
String.utf16_index_of_byte/byte_index_of_utf16to convert between byte offsets and UTF-16 indices - Add
Global.parse_int_float: parseInt returning a float, exactly like JavaScript for values of any size - Add
Unicode.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"ß") - Add
Unicode.script,general_categoryandbinary_propertycharacter-set lookups with theUnicode.CharSetmodule: the Unicode property tables behind JavaScript's\p{...}escapes, e.g.Unicode.script "Greek" - Add
Quickjs_c.Libunicode.char_range/char_range_free: raw bindings to libunicode's character range tables (unicode_script,unicode_general_category,unicode_prop)
0.4.2
- Rename
RegExp.lastIndex->RegExp.last_index - Rename
RegExp.setLastIndex->RegExp.set_last_index
0.4.1
- Remove
uutf
0.4.0
- Breaking: Migrated from
bellard/quickjstoquickjs-ng/quickjs- the actively maintained community fork with Unicode 17.0.0 support, better spec compliance, and ongoing development - Fix
Global.parse_floatfor incomplete exponents ("1e", "1e+", "1e-") to return the parsed number instead ofNone, matching JavaScript spec. Workaround for quickjs-ng/quickjs#1259
0.3.0
- Fix openSUSE
Breaking: Reorganized API to mirror JavaScript built-in objects for
quickjsDtoa→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.)- New
String.Prototypemodule (to_lower_case, to_upper_case, normalize) - New
Unicodemodule for character-level operations (is_cased, is_id_start, canonicalize, etc.)
- Fix String.Prototype.lastIndexOf
- Fix String.Prototype.match
0.2.0
- Support unicode in RegExp
- Support named groups in RegExp
- Bind to dtoa (Dtoa, Atod, IntToString)
0.1.2
- Support for named groups
- Change
RegExp.execinterface to returnresult
0.1.1
Bug fix for RegExp backtracking when not find a match
0.1.0
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.