Lady [Sun, 3 Dec 2023 19:51:19 +0000 (14:51 -0500)]
Add methods for own entries and values to object.js
Lady [Sun, 3 Dec 2023 18:24:08 +0000 (13:24 -0500)]
Add is⸺ method to generated proxy constructors
Lady [Sun, 3 Dec 2023 17:57:41 +0000 (12:57 -0500)]
Add maybe to `function.js`
Lady [Sat, 25 Nov 2023 18:34:26 +0000 (13:34 -0500)]
Minor refactors to numeric.js
Lady [Sat, 25 Nov 2023 18:29:19 +0000 (13:29 -0500)]
Small improvements to string.js
- Correctly set `Matcher::constructor`.
- Be safer about property descriptors when defining properties.
- Minor refactors.
Lady [Sat, 25 Nov 2023 18:11:05 +0000 (13:11 -0500)]
Be safer about iterable.js property descriptors
Lady [Sat, 25 Nov 2023 18:01:45 +0000 (13:01 -0500)]
Build function.js on top of object.js infra
This allows us to be a little safer about our property descriptors.
Lady [Sat, 25 Nov 2023 17:28:29 +0000 (12:28 -0500)]
Swap some things between value.js and object.js
- Property Descriptor record functions → object.js. Leaving
`completePropertyDescriptor` in value.js for now, since it does not
expect specifically a property descriptor record.
- `toPropertyKey` → value.js
Lady [Fri, 24 Nov 2023 23:18:42 +0000 (18:18 -0500)]
Refactor object.js not to depend on function.js
This unfortunately requires a literal re·implementation of
`Object.assign`, but it’s otherwise worth it.
This commit also adds `defineOwnDataProperty` and
`defineOwnNonenumerableDataProperty` for convenience.
Lady [Fri, 24 Nov 2023 17:03:52 +0000 (12:03 -0500)]
Make getOwnPropertyDescriptor(s) safer
Return proxied property descriptor records from these functions (which
inherit from null) to prevent weirdness should somebody try to modify
`Object.prototype`.
Lady [Fri, 24 Nov 2023 16:37:08 +0000 (11:37 -0500)]
De‐classify property descriptors; move to value.js
The conversion to and from property descriptors doesn’t only look at
own properties, so it is convenient to create ones with a null
prototype (to prevent attempts at hacking into, e·g,
`Object.prototype`). This means the existing class‐based approach
isn’t viable and a more functional approach is better.
Many of the property descriptor functions explicitly handle undefined,
so treating them as values and not objects makes sense, even if some
(`completePropertyDescriptor`, `toPropertyDescriptor`) throw if their
argument is not an object.
Lady [Thu, 23 Nov 2023 02:00:45 +0000 (21:00 -0500)]
Add createProxyConstructor to function.js
Lady [Wed, 22 Nov 2023 02:43:10 +0000 (21:43 -0500)]
Refactor some functions in function.js to simplify
Lady [Wed, 22 Nov 2023 02:27:25 +0000 (21:27 -0500)]
Make create⸺Function setup more flexible
- Don’t assign the `.prototype` if it doesn’t already exist. (Note: It
is not possible for a constructor to lack a `.prototype` without
proxying.)
- Don’t change the prototype of a function which has already had its
prototype changed.
Lady [Wed, 22 Nov 2023 02:27:10 +0000 (21:27 -0500)]
Move toFunctionName into value.js
This is a value coercion function akin to `toLength` or `toIndex`.
Lady [Tue, 21 Nov 2023 03:04:38 +0000 (22:04 -0500)]
Move numeric constants into value.js
This follows the pattern of declaring symbol constants here so they are
accessible everywhere.
Lady [Sun, 19 Nov 2023 16:05:03 +0000 (11:05 -0500)]
Move isConcatSpreadable[Object] into object.js
This is an object test which is not *necessarily* about collections.
Lady [Sun, 19 Nov 2023 16:04:50 +0000 (11:04 -0500)]
Simplify implementation of defineOwnProperties
There was no reason to create a custom iterable here; just iterate the
splat array manually.
Lady [Sun, 19 Nov 2023 16:04:35 +0000 (11:04 -0500)]
Drop dependency on object.js from symbol.js
This is only a loadtime dependency and not necessary.
Lady [Sun, 19 Nov 2023 16:04:12 +0000 (11:04 -0500)]
Move arraylike functions into object.js
Arraylikes are treated as objects, even when they aren’t literally
objects (e·g strings). `isArraylikeObject` notably checks for both.
Lady [Fri, 17 Nov 2023 02:47:41 +0000 (21:47 -0500)]
Move isArrayIndexString into string.js
…and add some missing tests for isIntegerIndexString.
Lady [Fri, 17 Nov 2023 02:26:48 +0000 (21:26 -0500)]
Move string functions from value.js to string.js
These actually make more sense here!
Lady [Fri, 17 Nov 2023 02:09:38 +0000 (21:09 -0500)]
Move isIntegerIndexString into value.js
While potentially relevant to collections, this function is actually
about classifying types of value.
Lady [Fri, 17 Nov 2023 01:45:04 +0000 (20:45 -0500)]
Test constructability, name, length in numeric.js
Lady [Sat, 11 Nov 2023 03:36:51 +0000 (22:36 -0500)]
Rename Ascii‐related functions in string.js
Treating Ascii as a pronouncable acronym, not an unpronouncable one.
Lady [Sat, 11 Nov 2023 03:12:06 +0000 (22:12 -0500)]
Rename scalarValueString → toScalarValueString
Also update the implementation to use the new `String::toWellFormed`
method.
Lady [Sat, 11 Nov 2023 02:55:58 +0000 (21:55 -0500)]
Test constructability, name, length in string.js
Lady [Sun, 5 Nov 2023 21:11:51 +0000 (16:11 -0500)]
Refactor object.js to use createArrowFunction
Lady [Sun, 5 Nov 2023 20:41:30 +0000 (15:41 -0500)]
Redo create⸺Function A·P·I in function.js
`createCallableFunction` and `createIllegalConstructor` are now joined
by a `createArrowFunction`, and all three have extremely similar
interfaces. Further refactoring is probably necessary elsewhere in the
codebase to make use of these changes.
Lady [Sun, 29 Oct 2023 23:26:53 +0000 (19:26 -0400)]
Move arraylike & index functions → values.js
Lengths and indices are properly kinds of values, not kinds of
collections, and this enables their use much earlier in the dependency
chain.
Lady [Sat, 21 Oct 2023 19:47:08 +0000 (15:47 -0400)]
Test constructability, name, length in iterable.js
Lady [Sat, 21 Oct 2023 19:29:12 +0000 (15:29 -0400)]
Improve object.js a·p·i
- Add tests for functions which were formerly just re·exports of
standard library functions.
- Test constructibility, name, and length for all exported functions.
- Replace `isFrozenObject` and `isSealedObject` with `isUnfrozenObject`
and `isUnsealedObject`, as the former versions return _true_, not
_false_, when provided with a non·object argument.
- Revise `setPrototype` to have better behaviours than the Ecmascript
implementation when provided with a non·object argument.
Lady [Tue, 5 Sep 2023 00:49:47 +0000 (20:49 -0400)]
Cast to primitive when creating function names
This matches the behaviour of `toPropertyKey`, which is a soft spec
prerequisite (`SetFunctionName` takes a property key argument).
Lady [Tue, 5 Sep 2023 00:35:57 +0000 (20:35 -0400)]
Define names for LazyLoader getters & setters
This commit also fixes some of the `LazyLoader` tests.
Lady [Tue, 5 Sep 2023 00:27:48 +0000 (20:27 -0400)]
Cast to function name in createCallableFunction
This requires moving the definition of `toFunctionName` inside the same
closure as `createCallableFunction` to ensure that it is defined before
`createCallableFunction` is called (e·g when defining
`ordinaryHasInstance`).
Lady [Mon, 4 Sep 2023 22:38:25 +0000 (18:38 -0400)]
Test createCallableFunction names and lengths
Lady [Mon, 4 Sep 2023 22:37:35 +0000 (18:37 -0400)]
Test function lengths in {value∣function∣symbol}.js
Lady [Mon, 4 Sep 2023 22:25:40 +0000 (18:25 -0400)]
Add toFunctionName to function.js
Lady [Mon, 4 Sep 2023 21:34:27 +0000 (17:34 -0400)]
Add symbolToString and symbolValue to symbol.js
Lady [Mon, 4 Sep 2023 21:15:24 +0000 (17:15 -0400)]
Rename make⸺ to create⸺ in function.js
“make⸺” names are used in the Ecmascript specification to describe
in‐place modifications. These functions return new values, so “create”
is more appropriate.
Lady [Mon, 4 Sep 2023 20:57:00 +0000 (16:57 -0400)]
Create symbol.js module with getSymbolDescription
Lady [Mon, 4 Sep 2023 19:54:46 +0000 (15:54 -0400)]
Add makeIllegalConstructor to functions.js
Lady [Mon, 4 Sep 2023 19:47:12 +0000 (15:47 -0400)]
Test function.js non·constructor constructability
Lady [Sat, 22 Jul 2023 07:42:24 +0000 (00:42 -0700)]
Ensure each function in function.js has proper name
Also provides a wrapper for `constructor` for parity even though this
isn’t strictly required, and simplifies the implementation of
`isConstructor` to make use of `completesNormally`.
Lady [Sat, 22 Jul 2023 07:39:17 +0000 (00:39 -0700)]
Add completesNormally to function.js
This is a convenience function which returns true if calling the
argument results in a normal completion (i·e not a throw), and false
otherwise.
Lady [Sat, 22 Jul 2023 07:30:18 +0000 (00:30 -0700)]
Use strict asserts in function.test.js
Also test to ensure that getters and setters are not constructable.
Lady [Mon, 4 Sep 2023 19:37:32 +0000 (15:37 -0400)]
Test value.js non·constructor constructability
Lady [Sat, 22 Jul 2023 06:39:26 +0000 (23:39 -0700)]
Ensure each function in value.js has correct name
This requires making `sameValue` a wrapper of `Object.is` instead of
literally the same function.
Lady [Sat, 22 Jul 2023 06:52:19 +0000 (23:52 -0700)]
Use strict asserts in value.test.js
Lady [Sat, 22 Jul 2023 06:30:50 +0000 (23:30 -0700)]
Add iterator function builders; use in string.js
This commit adds a number of new `⸺IteratorFunction` functions in a
new `iterable.js` module, for building “iterator functions” from
various kinds of iterable object (as well as generator functions, which
are not themselves iterable). These functions are useful
metaprogramming tools for creating iterators akin to those produced by
the native Ecmascript builtins like `Array::values` or `Map::entries`
when starting from an already‐iterable base value but needing to map it
somehow.
The existing functions `codeUnits`, `codepoints`, and `scalarValues`
already fell into this category and have been refactored to make use of
the new technique.
Lady [Tue, 27 Jun 2023 01:07:19 +0000 (18:07 -0700)]
Add buffer getters and setters to binary.js
These are rough equivalents to the `DataView` methods, but can be
called with any kind of array buffer or array buffer view. Internally,
they (weakly) remember a `DataView` instance for each buffer and use
that for accessing values (to ensure correct endianness behaviour).
Lady [Mon, 26 Jun 2023 02:18:53 +0000 (19:18 -0700)]
Add arrayBufferSlice to binary.js
Lady [Mon, 26 Jun 2023 01:57:06 +0000 (18:57 -0700)]
Support SharedArrayBuffer; drop isDataView
- `SharedArrayBuffer` counts as an array buffer; use
`isArrayBuffer($) && !isSharedArrayBuffer($)` to detect only
non‐shared buffers.
- `isDataView` is no longer supported as a separate function; use
`isArrayBufferView($) && !isTypedArray($)` to detect data views.
Lady [Mon, 26 Jun 2023 01:54:33 +0000 (18:54 -0700)]
Apply various minor updates to binary.js
Lady [Sun, 25 Jun 2023 05:54:54 +0000 (22:54 -0700)]
Rename is⸺ to is⸺Object in object.js
Lady [Sun, 25 Jun 2023 05:25:22 +0000 (22:25 -0700)]
Apply various minor formatting changes
Lady [Sun, 25 Jun 2023 05:19:23 +0000 (22:19 -0700)]
Rename to{I∣Ui}ntN to to{S∣Uns}ignedIntegralNumeric
“int·N” and “u·int·N” are not really ♓🌟 Piscēs terms.
Lady [Sun, 25 Jun 2023 00:09:30 +0000 (17:09 -0700)]
Fix linting errors in string.*
Lady [Sun, 25 Jun 2023 00:06:14 +0000 (17:06 -0700)]
Export welknown symbols from value.js and use them
This commit changes function.js to depend on value.js and not the other
way around.
Lady [Sat, 24 Jun 2023 23:54:50 +0000 (16:54 -0700)]
Use === more frequently in binary.js
The convention is to use `===` in situations where type·casting is
known not occur.
Lady [Sat, 24 Jun 2023 23:47:06 +0000 (16:47 -0700)]
Add various is⸺ functions to binary.js
Lady [Sat, 24 Jun 2023 04:32:04 +0000 (21:32 -0700)]
Add isArrayBufferView & toArrayBuffer to binary.js
This also removes a previous less‐than‐ideal dependency on `instanceof`
when converting arguments to array buffers for base⸺ conversions.
Lady [Sat, 24 Jun 2023 03:23:12 +0000 (20:23 -0700)]
Fix permissions of binary.test.js
For some reason this file had execute permissions, which are wholly
unnecessary.
Lady [Mon, 22 May 2023 02:50:19 +0000 (19:50 -0700)]
Make base32 handling less forgiving
Ordinarily, one only encounters base32 strings of length 0, 2, 4, 5, or
7 characters (mod 8). If it is of length 3 or 6, the final character is
in the middle of an incomplete byte. As with length 1, this should
probably throw an error, as the other alternative is to entirely ignore
the character.
(It already did throw an error before this change, but
unintentionally.)
Lady [Sat, 20 May 2023 01:05:32 +0000 (18:05 -0700)]
Add ::flags override to Matcher
Otherwise this code will break if new flags are added but not supported
by ♓🌟 Piscēs.
Lady [Sat, 20 May 2023 01:05:27 +0000 (18:05 -0700)]
Use strict equals in Matcher constraint tests
Otherwise Deno will see Matcher is a RegExp and cast to a string.
Lady [Sat, 20 May 2023 01:05:19 +0000 (18:05 -0700)]
Add base32 support to binary.js
Includes both the RFC base32 definition and the “W·R·M·G” definition by
Douglas Crockford.
Lady [Sat, 20 May 2023 01:05:02 +0000 (18:05 -0700)]
Add base16 support to binary.js
Just iterating over the bytes and doing `$.toString(16).toUpperCase()`
or `parseInt($, 16)` might actually be faster, but I kind of like using
an actual algorithm to ensure parity with base64 ⁊·c processing.
Lady [Fri, 19 May 2023 07:20:39 +0000 (00:20 -0700)]
Fix base64 implementation
I believe that the old implementation was just wrong, and it simply
wasn’t caught because Deno’s `assertEquals` doesn’t actually know what
to do with raw buffers. Wrapping them to build typed arrays creates
working tests, and this implementation matches observed behaviour with
`atob` and `btoa`.
Lady [Sun, 25 Sep 2022 07:52:56 +0000 (00:52 -0700)]
Remove irregular whitespace
Lady [Sun, 25 Sep 2022 07:48:49 +0000 (00:48 -0700)]
Polish object.js a little
Lady [Sun, 25 Sep 2022 07:24:35 +0000 (00:24 -0700)]
Polish binary.js a little bit.
Internal functions now have some code documentation, and the runtime
dependency on arrays being iterable (for splatting arguments) was
removed.
Lady [Sun, 25 Sep 2022 07:00:10 +0000 (00:00 -0700)]
Rename base64.js to binary.js; reorganize contents
`atob` and `btoa` now have the much clearer names `base64Binary` and
`base64String`; filename‐safe equivalents have been added.
The intention is to add the base16 and base32 formats from R·F·C 3548
as well, although that work is still forthcoming.
Lady [Tue, 20 Sep 2022 03:39:11 +0000 (20:39 -0700)]
Add to⸺Notation functions to numeric.js
The default Number::toString method provides a result which is
difficult to parse. Number::toExponential and Number::toFixed are
better; they are now provided via toExponentialNotation and
toFixedDecimalNotation. Support for big·ints has been added as well.
Lady [Tue, 20 Sep 2022 03:34:38 +0000 (20:34 -0700)]
toIntegerOrInfinity 🔜 toIntegralNumberOrInfinity
This new name is clearer, especially as this function now accepts
big·int arguments.
Lady [Mon, 19 Sep 2022 02:31:02 +0000 (19:31 -0700)]
Add toIntegralNumber to numeric.js
Also allow big·int arguments in toIntegerOrInfinity.
Lady [Sun, 18 Sep 2022 22:02:31 +0000 (15:02 -0700)]
Add POSITIVE_ZERO and NEGATIVE_ZERO to numeric.js
Lady [Thu, 8 Sep 2022 05:20:46 +0000 (22:20 -0700)]
Provide fake external constructor for Matcher
Classes which depend on identity for behaviours should not be exposed
because this inheritance can be modified at runtime. This commit
provides a fake Matcher constructor which simply calls the real one.
This has a side‐effect of reducing the amount of prototype modification
which this class setup entailed, at the cost of needing to manually
redefine all the properties from the internal Matcher constructor
prototype onto the external one.
Lady [Thu, 8 Sep 2022 04:14:53 +0000 (21:14 -0700)]
Pass exec result to constraint in Matcher
Lady [Thu, 8 Sep 2022 03:17:51 +0000 (20:17 -0700)]
Add support for constraints to Matcher
Lady [Thu, 8 Sep 2022 02:13:16 +0000 (19:13 -0700)]
Make toIntN & toUintN more accommodating
These used to not handle non‐integers well, and now do gracefully.
Lady [Sun, 4 Sep 2022 21:47:15 +0000 (14:47 -0700)]
Treat object function args more consistently
Functions like getOwnPropertyKeys now do not require that their
arguments are objects, but *do* require that they are not null or
undefined. Similarly, toObject now throws for null and undefined
values, rather than returning an empty object. Use `toObject($ ?? {})`
if you need the old behaviour.
Lady [Sun, 4 Sep 2022 21:19:38 +0000 (14:19 -0700)]
Add toString to string.js
Also properly casts some arguments of string functions to strings.
Lady [Sun, 4 Sep 2022 21:15:36 +0000 (14:15 -0700)]
Add toIntegerOrInfinity to numeric.js
Lady [Sat, 23 Jul 2022 23:13:27 +0000 (16:13 -0700)]
Add LazyLoader class
Lady [Sat, 23 Jul 2022 19:20:43 +0000 (12:20 -0700)]
Add isArraylikeObject
Also renames lengthOfArrayLike 🔜 lengthOfArraylike.
Lady [Sat, 23 Jul 2022 08:37:18 +0000 (01:37 -0700)]
Update README
Lady [Sat, 23 Jul 2022 08:17:12 +0000 (01:17 -0700)]
Refactor base64; remove runtime dependencies
Lady [Sat, 23 Jul 2022 07:19:58 +0000 (00:19 -0700)]
Refactor iri; remove runtime dependencies
Lady [Sat, 23 Jul 2022 04:27:35 +0000 (21:27 -0700)]
Add Matcher class for whole‐string matching
Lady [Sat, 23 Jul 2022 02:42:47 +0000 (19:42 -0700)]
Add arraylike functions and collection unit tests
Lady [Fri, 22 Jul 2022 02:47:55 +0000 (19:47 -0700)]
Add string functions and unit tests
Lady [Sun, 17 Jul 2022 22:18:57 +0000 (15:18 -0700)]
Add numeric functions and unit tests
Lady [Sun, 17 Jul 2022 17:52:45 +0000 (10:52 -0700)]
Remove dependencies of function.js; add tests
- No longer depends on mutable runtime bindings or other modules
- Unit tests for all function exports
Lady [Sun, 17 Jul 2022 20:45:08 +0000 (13:45 -0700)]
Split some object code into value and unit test
Also adds tests for module exports.
Lady [Sat, 9 Jul 2022 23:02:22 +0000 (16:02 -0700)]
Basic functions for object & function manipulation
Lady [Sat, 4 Jun 2022 23:12:17 +0000 (16:12 -0700)]
Add string functions
Lady [Sat, 21 May 2022 01:09:20 +0000 (18:09 -0700)]
L·E·I·R·I support
Lady [Tue, 17 May 2022 03:57:40 +0000 (20:57 -0700)]
More comprehensive support for RFC 3986 & RFC 3987
Lady [Sat, 30 Apr 2022 01:18:02 +0000 (18:18 -0700)]
PropertyDescriptor and frozenCopy
This page took 0.182915 seconds and 4 git commands to generate.