blob: d41a71a155c9c22e8eb5c0b6d7266170ccd74581 [file] [log] [blame]
// Copyright 2014 Cubane Canada, Inc. All rights reserved.
// See LICENSE for details.
/*---
info: |
Promise.prototype.then throws TypeError if Get(promise, "constructor") throws
Ref 25.4.5.3 step 4 ReturnIfAbrupt(C)
es6id: S25.4.5.3_A3.1_T1
author: Sam Mikes
description: Promise.prototype.then throws if Get(promise, "constructor") throws
---*/
var p = Promise.resolve("foo");
Object.defineProperty(p, "constructor", {
get: function() {
throw new Test262Error();
}
});
assert.throws(Test262Error, function() {
p.then(function() {
$ERROR("Should never be called.");
}, function() {
$ERROR("Should never be called.");
});
});