blob: 6606fdcdc10edf8b273abda65b01a12fee6678a6 [file] [log] [blame]
// Copyright 2014 Cubane Canada, Inc. All rights reserved.
// See LICENSE for details.
/*---
info: |
catch(arg) is equivalent to then(undefined, arg)
es6id: S25.4.5.1_A3.1_T1
author: Sam Mikes
description: catch is implemented in terms of then
flags: [async]
---*/
var obj = {};
var p = Promise.resolve(obj);
p.catch(function() {
$ERROR("Should not be called - promise is fulfilled");
}).then(function(arg) {
if (arg !== obj) {
$ERROR("Expected promise to be fulfilled with obj, got " + arg);
}
}).then($DONE, $DONE);