Black-box abstraction in JavaScript