summaryrefslogtreecommitdiff
path: root/test/built-ins/Promise/prototype/then/S25.4.5.3_A4.2_T1.js
blob: eecbe9af837bef2b431093304a50737f478a449c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Copyright 2014 Cubane Canada, Inc.  All rights reserved.
// See LICENSE for details.

/*---
info: |
    PerformPromiseThen
    Ref 25.4.5.3.1
es6id: S25.4.5.3_A4.2_T1
author: Sam Mikes
description: Promise.prototype.then treats non-callable arg1, arg2 as undefined
flags: [async]
---*/

var obj = {};
var p = Promise.resolve(obj);

p.then(3, 5)
    .then(function (arg) {
        if (arg !== obj) {
            $ERROR("Expected resolution object to be passed through, got " + arg);
        }
    }).then($DONE, $DONE);