summaryrefslogtreecommitdiff
path: root/test/built-ins/Promise/prototype/resolve/S25.4.4.5_A4.1_T1.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/built-ins/Promise/prototype/resolve/S25.4.4.5_A4.1_T1.js')
-rw-r--r--test/built-ins/Promise/prototype/resolve/S25.4.4.5_A4.1_T1.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/built-ins/Promise/prototype/resolve/S25.4.4.5_A4.1_T1.js b/test/built-ins/Promise/prototype/resolve/S25.4.4.5_A4.1_T1.js
new file mode 100644
index 000000000..e552c3c1a
--- /dev/null
+++ b/test/built-ins/Promise/prototype/resolve/S25.4.4.5_A4.1_T1.js
@@ -0,0 +1,22 @@
+// Copyright 2014 Cubane Canada, Inc. All rights reserved.
+// See LICENSE for details.
+
+/*---
+info: >
+ Section 25.4.1.4.2
+author: Sam Mikes
+description: self-resolved Promise throws TypeError
+---*/
+
+var resolveP,
+ p = new Promise(function (resolve) { resolveP = resolve; });
+
+resolveP(p);
+
+p.then(function () {
+ $ERROR("Should not fulfill: should reject with TypeError.");
+}, function (err) {
+ if (!(err instanceof TypeError)) {
+ $ERROR("Expected TypeError, got " + err);
+ }
+}).then($DONE, $DONE);