HydrateJS icon indicating copy to clipboard operation
HydrateJS copied to clipboard

should serialize undefined

Open NodeGuy opened this issue 13 years ago • 5 comments

If you add undefined to the list of primitives, the "should serialize primitives" test fails:

it("should serialize primitives", function() {
  var inputs = [undefined, 3, "foo", ["a", 3, "bar"]]

NodeGuy avatar Sep 01 '12 21:09 NodeGuy

Thanks BallBearing, should be fixed in above commit.

nanodeath avatar Sep 02 '12 04:09 nanodeath

There still appears to be problems with this.

var hydrate = new Hydrate();
hydrate.parse(hydrate.stringify([undefined])); // => ["__hydrate_undef"]

skeeto avatar Mar 12 '13 01:03 skeeto

Hi @skeeto -- can you double-check? I'm running those exact commands and I'm getting [undefined] as expected.

nanodeath avatar Mar 16 '13 16:03 nanodeath

Using the pre-compiled version hosted here:

http://blog.maxaller.name/hydrate/gen/Hydrate.js (sha1sum: 6009764ff0659af87a44b1d4ecbb0d708a4c73df)

I'm still getting ["__hydrate_undef"] with both Firefox and Chrome.

skeeto avatar Mar 16 '13 17:03 skeeto

Ah. Yes, that probably hasn't been updated -- it doesn't happen automatically. I'm making some more changes today, but I'll update it after that. I'm making some changes that will make it easier to compile it yourself, too.

nanodeath avatar Mar 16 '13 17:03 nanodeath