Skip to content
Permalink
Browse files

2.0: Rewrite data.js (Incl. event, manipulation, tests)

  • Loading branch information...
rwaldron committed Feb 3, 2013
1 parent ed0e2d1 commit 7f94a5cc3a167a710576c008da2c186a98ce2dd4
Showing with 354 additions and 358 deletions.
  1. +214 −227 src/data.js
  2. +2 −2 src/event.js
  3. +31 −27 src/manipulation.js
  4. +20 −0 test/data/onbeforeunload.html
  5. +40 −34 test/data/testrunner.js
  6. +36 −2 test/unit/data.js
  7. +11 −66 test/unit/event.js

3 comments on commit 7f94a5c

@gibson042

This comment has been minimized.

Copy link
Member

replied Feb 3, 2013

This is really good stuff; much cleaner than the previous. My only final note is a recommendation to standardize checks against the indexOf return values... at a glance, >= 0 and < 0 seem to be about equally represented elsewhere in our source (addressing that is a job for another day), so I'd lean towards one of those.

@rwaldron

This comment has been minimized.

Copy link
Member Author

replied Feb 3, 2013

I'll go through it now, thanks for the review :)

@jaubourg

This comment has been minimized.

Copy link
Member

replied Feb 4, 2013

I really don't get the prototype-based approach. I like the two Data instances but you'd gain a lot of bytes by using a module based approach to construct said instances. You'd also probably won't have to expose all the methods to boot (another gain). I'm also a bit concerned with the liberal use of indexOf on an array that could end up being quite big (even in apps that never manipulate big collections -- since it will contain all the nodes that have data, am i right?). Have you benchmarked this against an app that attaches data to a lot of nodes concurrently?

Please sign in to comment.
You can’t perform that action at this time.