whatwg/streams — pull request #94 by tyoshino (2014-03-03 23:09:25+00:00)
Title: BWS.write: Create promise only when necessary

promise created in the step 1 is used only when [[state]] is writable or waiting.
Move it into each case block.

Reference implementation is untouched since we're extracting handlers and making
it consistent with the spec algorithm just seems to make the code dirty.