Commit Graph

41 Commits

Author SHA1 Message Date
Jasmijn Wellner
4545391591 Release 1.2
It has been long overdue. Let's serialize the world!

Some important changes since 1.1:

- Can serialize metatables now (optionally disabled with `bitser.includeMetatables`)
- Added an extension API
- Removed support for cdata, which was just too buggy to hold on. More robust support would probably need to depend on ffi-reflect, which is best done by an extension library
2024-12-31 10:47:08 +01:00
Jasmijn Wellner
c0b0e12dce Fix bug #33 by changing the contract
"Pray I do not alter it any further."

On a serious note, I could not find a good reason to keep the old behaviour. It was niche at best, and class libraries tend to ultimately depend on `setmetatable` anyway, which just returns the original table, which has been mutated.

Now the return value of `deserializer` is simply ignored, and it is presumed the original table *is* the instance.
2024-12-31 10:36:41 +01:00
Jasmijn Wellner
c9db225486 Add support for an any number of additional types
Type code 255 will be followed by an encoded number, which signifies the additional type code. No additional types are specified at the moment.
2024-12-29 20:51:45 +01:00
Jasmijn Wellner
3fd140cb28 Add a test for rxi/classic 2024-12-29 17:54:42 +01:00
Jasmijn Wellner
608c1c4792 Add a test for recursive instances
Currently they are not supported (previously they would silently give potentially wrong output)
2024-12-29 17:29:36 +01:00
Jasmijn Wellner
8bfdf3a961 Add back in tests for types 251 and 252
They were previously used for cdata and ctypes
2024-12-29 17:20:51 +01:00
Jasmijn Wellner
74a2359cd6 Merge branch 'extensions' 2024-12-29 16:02:00 +01:00
Jasmijn Wellner
c95cb0d77a Remove cdata support
See https://github.com/gvx/bitser/issues/28#issuecomment-2564723498
2024-12-29 14:28:04 +01:00
Jasmijn Wellner
f423938ec0 Silence warnings 2024-12-28 17:10:38 +01:00
Jasmijn Wellner
5d9ff6fa1a Trying to deal with bug #33 2024-12-28 16:44:44 +01:00
R.E.J. Wellner
1fc6c6171c Add initial version of the extension API 2021-03-30 17:14:14 +02:00
Adrien Bertrand
1d3ebe04cf
metatables: feature to toggle (de)serializing them. Fix #21. (#22) 2021-02-14 18:53:02 +00:00
Jasmijn Wellner
66042a5b09 Fix Slither test
Slither no longer requires class.private.
2020-12-26 15:20:06 +01:00
Jasmijn Wellner
f6e78d0c2a Update tests
253 is no longer unassigned
2020-12-26 15:00:06 +01:00
Jasmijn Wellner
02476589e3 Add ability to serialize metatables 2020-12-26 14:22:57 +01:00
R.E.J. Wellner
1a9f3d7631 Don't add cdata to seen! 2020-04-29 01:42:38 +02:00
R.E.J. Wellner
cd6ac6f7cb will this work?
at this point, i don't even hope any more
2020-04-28 17:15:06 +02:00
R.E.J. Wellner
776b056d69 either i don't understand luaspec
or i'm losing my mind
2020-04-28 17:11:46 +02:00
R.E.J. Wellner
772f090413 Change tests again
Would be useful if I could run luaspec locally but oh well
2020-04-28 17:03:33 +02:00
R.E.J. Wellner
b7cc46f4bf Fix one of the tests 2020-04-28 16:56:11 +02:00
R.E.J. Wellner
caf972ca80 Add support for cdata
More testing needed
2020-04-28 16:51:41 +02:00
R.E.J. Wellner
5a134b4fce Close #13
Turns out I never fixed this one bug...
2020-04-27 19:47:09 +02:00
Robin Wellner
dd3034117f
Return true in mock write so asserts work 2018-02-20 15:24:17 +01:00
buckle2000
3571bdb928 Adds support for Moonscript classes (#6)
Many thanks to @buckle2000
2017-01-08 02:18:11 +01:00
Robin Wellner
3b8dae1dde Add tests for resources whose name is also used as a string 2016-10-31 12:20:29 +01:00
Kyle McLamb
4fe34942c0 Fix reference serialization inside classes 2016-05-11 00:57:41 -04:00
Robin Wellner
2ad9e981bd Hopefully fix coverage 2016-02-23 14:47:16 +01:00
Robin Wellner
4989dbf403 Yet another attempt... 2016-02-23 14:42:27 +01:00
Robin Wellner
d6ac0e2636 I hope it'll recognise the global now... 2016-02-23 14:37:22 +01:00
Robin Wellner
9aabbdbf0e Add more tests 2016-02-23 14:29:29 +01:00
Robin Wellner
6b8208a991 Prevent reading past the end of the buffer 2016-02-16 02:45:24 +01:00
Robin Wellner
93de15580f fix typo in test 2016-02-16 02:17:48 +01:00
Robin Wellner
5eec3575ab forgot to require ffi 2016-02-16 02:11:09 +01:00
Robin Wellner
c624623efe add ability to load from raw data
see https://love2d.org/wiki/Data:getPointer
2016-02-16 02:08:07 +01:00
Robin Wellner
ba62015f30 more tests! 2016-02-16 01:32:08 +01:00
Robin Wellner
0d0bb54405 Fix sloppy errors (forgot to pass an argument, haserror -> has_error) 2016-02-15 15:24:07 +01:00
Robin Wellner
071da607d0 typos in tests :( 2016-02-15 15:16:14 +01:00
Robin Wellner
92815b33e3 add more tests to increase coverage 2016-02-15 15:11:17 +01:00
Robin Wellner
80c130ea8d forgot to actually register the class i was testing 2016-02-15 14:39:41 +01:00
Robin Wellner
5d27470cce more testing and lint stuff 2016-02-15 14:34:52 +01:00
Robin Wellner
9a5fdcbab8 add travis and busted files 2016-02-15 14:06:25 +01:00