Guest User

Untitled

a guest
Jul 18th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.60 KB | None | 0 0
  1. 17:04 < ashb> Wes-: btw just how much do you want toSource output to be evalable?
  2. 17:05 < ashb> its kinda a pain as a debugging repr if it is
  3. 17:05 < Wes-> ashb: absolutely convinced it should be
  4. 17:05 < Wes-> if you want debugging repr, should be some other method
  5. 17:05 < MisterN> ashb: how about a toDebugString()?
  6. 17:06 < ashb> Wes-: and what should toSource return when its not?
  7. 17:06 < Wes-> ashb: when it's not what?
  8. 17:06 < ashb> such as for a DOM node that to get the same state would need the entire document
  9. 17:06 < Wes-> ashb: do DOM nodes have toSource methods?
  10. 17:06 < ashb> not currently
  11. 17:07 < Wes-> well there ya go, lol
  12. 17:07 < Wes-> seriously, prepending require("binary") to the output is not a big readability impediment
  13. 17:07 < ashb> nor does anything not from a mozilla engine mind :)
  14. 17:07 < Wes-> OTOH it is a /huge/ functionality difference
  15. 17:08 < Wes-> I frequently use .toSource(), aka uneval, for JSON-like operations
  16. 17:08 < Wes-> you could theoretically have an object of objects of ByteStrings, call toSource() on the top-level one, store it on disk, and eval it at a later date
  17. 17:09 < Wes-> without the require() statement, that code is no longer reliable
  18. 17:10 < ashb> that doesn't work very well for packages.
  19. 17:10 < ashb> well
  20. 17:10 < ashb> it means a package has to know how it can be indentified globally
  21. 17:10 < ashb> which given package names can be aliases poses some problems
  22. 17:10 < ashb> but i guess each package should have a canonical name
  23. 17:11 < ashb> require('com.github/ashb/http-fetch-flusspferd#http-fetch') i guess
  24. 17:11 < ashb> could be the canonical form
Add Comment
Please, Sign In to add comment