tc39/test262 — pull request #43 by smikes (2014-07-17 17:58:02+00:00)
Title: Initial promise tests

Manually created some Promise tests.

I believe the semantics of the $DONE() function should be changed. At present $DONE(undefined) is reported as an error. A standard testing idiom is to do this:

Promise.resolve().then(function delayed() {
// assertions

return;
}).then($DONE,$DONE);

this idiom results in a call to `$DONE(some_error_object)` if any assertion throws, and `$DONE(undefined)` if none throws. (The `undefined` comes from the return value of function `delayed`)

This PR consists of two patches; one to commit the Promise tests, and one to change the behavior of $DONE.