summaryrefslogtreecommitdiff
path: root/test/built-ins/GeneratorPrototype/throw
diff options
context:
space:
mode:
authorAndré Bargull <andre.bargull@gmail.com>2018-02-09 09:09:47 -0800
committerLeo Balter <leonardo.balter@gmail.com>2018-02-09 12:09:47 -0500
commitf95b56ab28c5f18150f30fbfa889a4f6ba0e50a1 (patch)
treed403f704c1b6a1842f12df380651919beaaf5fef /test/built-ins/GeneratorPrototype/throw
parenta01de4a722d088055a7d84d8c691ddd7109edb34 (diff)
downloadqtdeclarative-testsuites-f95b56ab28c5f18150f30fbfa889a4f6ba0e50a1.tar.gz
Revert "js-beautify: make all indentation consistent (depth & character) (#1409)" (#1412)
This reverts commit a01de4a722d088055a7d84d8c691ddd7109edb34.
Diffstat (limited to 'test/built-ins/GeneratorPrototype/throw')
-rw-r--r--test/built-ins/GeneratorPrototype/throw/from-state-completed.js5
-rw-r--r--test/built-ins/GeneratorPrototype/throw/from-state-executing.js1
-rw-r--r--test/built-ins/GeneratorPrototype/throw/from-state-suspended-start.js5
-rw-r--r--test/built-ins/GeneratorPrototype/throw/this-val-not-generator.js32
-rw-r--r--test/built-ins/GeneratorPrototype/throw/this-val-not-object.js48
-rw-r--r--test/built-ins/GeneratorPrototype/throw/try-catch-before-try.js5
-rw-r--r--test/built-ins/GeneratorPrototype/throw/try-catch-following-catch.js5
-rw-r--r--test/built-ins/GeneratorPrototype/throw/try-catch-within-catch.js5
-rw-r--r--test/built-ins/GeneratorPrototype/throw/try-catch-within-try.js1
-rw-r--r--test/built-ins/GeneratorPrototype/throw/try-finally-before-try.js7
-rw-r--r--test/built-ins/GeneratorPrototype/throw/try-finally-following-finally.js5
-rw-r--r--test/built-ins/GeneratorPrototype/throw/try-finally-nested-try-catch-within-catch.js5
-rw-r--r--test/built-ins/GeneratorPrototype/throw/try-finally-nested-try-catch-within-finally.js5
-rw-r--r--test/built-ins/GeneratorPrototype/throw/try-finally-nested-try-catch-within-inner-try.js1
-rw-r--r--test/built-ins/GeneratorPrototype/throw/try-finally-nested-try-catch-within-outer-try-after-nested.js5
-rw-r--r--test/built-ins/GeneratorPrototype/throw/try-finally-nested-try-catch-within-outer-try-before-nested.js5
-rw-r--r--test/built-ins/GeneratorPrototype/throw/try-finally-within-finally.js5
-rw-r--r--test/built-ins/GeneratorPrototype/throw/try-finally-within-try.js5
18 files changed, 34 insertions, 116 deletions
diff --git a/test/built-ins/GeneratorPrototype/throw/from-state-completed.js b/test/built-ins/GeneratorPrototype/throw/from-state-completed.js
index 209ab9fed..3d8e6cbf5 100644
--- a/test/built-ins/GeneratorPrototype/throw/from-state-completed.js
+++ b/test/built-ins/GeneratorPrototype/throw/from-state-completed.js
@@ -9,16 +9,13 @@ features: [generators]
---*/
function E() {}
-
function* G() {}
var iter;
iter = G();
iter.next();
-assert.throws(E, function() {
- iter.throw(new E());
-});
+assert.throws(E, function() { iter.throw(new E()); });
var result = iter.next();
diff --git a/test/built-ins/GeneratorPrototype/throw/from-state-executing.js b/test/built-ins/GeneratorPrototype/throw/from-state-executing.js
index df1601517..2af2f73ab 100644
--- a/test/built-ins/GeneratorPrototype/throw/from-state-executing.js
+++ b/test/built-ins/GeneratorPrototype/throw/from-state-executing.js
@@ -37,7 +37,6 @@ features: [generators]
---*/
var iter, result;
-
function* g() {
iter.throw(42);
}
diff --git a/test/built-ins/GeneratorPrototype/throw/from-state-suspended-start.js b/test/built-ins/GeneratorPrototype/throw/from-state-suspended-start.js
index 3bf6296c3..53d44904e 100644
--- a/test/built-ins/GeneratorPrototype/throw/from-state-suspended-start.js
+++ b/test/built-ins/GeneratorPrototype/throw/from-state-suspended-start.js
@@ -10,7 +10,6 @@ features: [generators]
---*/
function E() {}
-
function* G() {
yield 1;
yield 2;
@@ -18,9 +17,7 @@ function* G() {
var iter;
iter = G();
-assert.throws(E, function() {
- iter.throw(new E());
-});
+assert.throws(E, function() { iter.throw(new E()); });
var result = iter.next();
diff --git a/test/built-ins/GeneratorPrototype/throw/this-val-not-generator.js b/test/built-ins/GeneratorPrototype/throw/this-val-not-generator.js
index fae6fe7b7..8667ad897 100644
--- a/test/built-ins/GeneratorPrototype/throw/this-val-not-generator.js
+++ b/test/built-ins/GeneratorPrototype/throw/this-val-not-generator.js
@@ -27,60 +27,44 @@ var GeneratorPrototype = Object.getPrototypeOf(g).prototype;
assert.throws(
TypeError,
- function() {
- GeneratorPrototype.throw.call({});
- },
+ function() { GeneratorPrototype.throw.call({}); },
'ordinary object (without value)'
);
assert.throws(
TypeError,
- function() {
- GeneratorPrototype.throw.call({}, 1);
- },
+ function() { GeneratorPrototype.throw.call({}, 1); },
'ordinary object (with value)'
);
assert.throws(
TypeError,
- function() {
- GeneratorPrototype.throw.call(function() {});
- },
+ function() { GeneratorPrototype.throw.call(function() {}); },
'function object (without value)'
);
assert.throws(
TypeError,
- function() {
- GeneratorPrototype.throw.call(function() {}, 1);
- },
+ function() { GeneratorPrototype.throw.call(function() {}, 1); },
'function object (with value)'
);
assert.throws(
TypeError,
- function() {
- GeneratorPrototype.throw.call(g);
- },
+ function() { GeneratorPrototype.throw.call(g); },
'generator function object (without value)'
);
assert.throws(
TypeError,
- function() {
- GeneratorPrototype.throw.call(g, 1);
- },
+ function() { GeneratorPrototype.throw.call(g, 1); },
'generator function object (with value)'
);
assert.throws(
TypeError,
- function() {
- GeneratorPrototype.throw.call(g.prototype);
- },
+ function() { GeneratorPrototype.throw.call(g.prototype); },
'generator function prototype object (without value)'
);
assert.throws(
TypeError,
- function() {
- GeneratorPrototype.throw.call(g.prototype, 1);
- },
+ function() { GeneratorPrototype.throw.call(g.prototype, 1); },
'generator function prototype object (with value)'
);
diff --git a/test/built-ins/GeneratorPrototype/throw/this-val-not-object.js b/test/built-ins/GeneratorPrototype/throw/this-val-not-object.js
index 8122f2b38..8b4d342be 100644
--- a/test/built-ins/GeneratorPrototype/throw/this-val-not-object.js
+++ b/test/built-ins/GeneratorPrototype/throw/this-val-not-object.js
@@ -26,90 +26,66 @@ var symbol = Symbol();
assert.throws(
TypeError,
- function() {
- GeneratorPrototype.throw.call(undefined);
- },
+ function() { GeneratorPrototype.throw.call(undefined); },
'undefined (without value)'
);
assert.throws(
TypeError,
- function() {
- GeneratorPrototype.throw.call(undefined, 1);
- },
+ function() { GeneratorPrototype.throw.call(undefined, 1); },
'undefined (with value)'
);
assert.throws(
TypeError,
- function() {
- GeneratorPrototype.throw.call(null);
- },
+ function() { GeneratorPrototype.throw.call(null); },
'null (without value)'
);
assert.throws(
TypeError,
- function() {
- GeneratorPrototype.throw.call(null, 1);
- },
+ function() { GeneratorPrototype.throw.call(null, 1); },
'null (with value)'
);
assert.throws(
TypeError,
- function() {
- GeneratorPrototype.throw.call(true);
- },
+ function() { GeneratorPrototype.throw.call(true); },
'boolean (without value)'
);
assert.throws(
TypeError,
- function() {
- GeneratorPrototype.throw.call(true, 1);
- },
+ function() { GeneratorPrototype.throw.call(true, 1); },
'boolean (with value)'
);
assert.throws(
TypeError,
- function() {
- GeneratorPrototype.throw.call('s');
- },
+ function() { GeneratorPrototype.throw.call('s'); },
'string (without value)'
);
assert.throws(
TypeError,
- function() {
- GeneratorPrototype.throw.call('s', 1);
- },
+ function() { GeneratorPrototype.throw.call('s', 1); },
'string (with value)'
);
assert.throws(
TypeError,
- function() {
- GeneratorPrototype.throw.call(1);
- },
+ function() { GeneratorPrototype.throw.call(1); },
'number (without value)'
);
assert.throws(
TypeError,
- function() {
- GeneratorPrototype.throw.call(1, 1);
- },
+ function() { GeneratorPrototype.throw.call(1, 1); },
'number (with value)'
);
assert.throws(
TypeError,
- function() {
- GeneratorPrototype.throw.call(symbol);
- },
+ function() { GeneratorPrototype.throw.call(symbol); },
'symbol (without value)'
);
assert.throws(
TypeError,
- function() {
- GeneratorPrototype.throw.call(symbol, 1);
- },
+ function() { GeneratorPrototype.throw.call(symbol, 1); },
'symbol (with value)'
);
diff --git a/test/built-ins/GeneratorPrototype/throw/try-catch-before-try.js b/test/built-ins/GeneratorPrototype/throw/try-catch-before-try.js
index bc2707e5c..bfd3086c7 100644
--- a/test/built-ins/GeneratorPrototype/throw/try-catch-before-try.js
+++ b/test/built-ins/GeneratorPrototype/throw/try-catch-before-try.js
@@ -10,7 +10,6 @@ features: [generators]
---*/
var unreachable = 0;
-
function* g() {
yield 1;
unreachable += 1;
@@ -32,9 +31,7 @@ assert.sameValue(
unreachable, 0, 'statement following `yield` not executed (paused at yield)'
);
-assert.throws(Test262Error, function() {
- iter.throw(new Test262Error());
-});
+assert.throws(Test262Error, function() { iter.throw(new Test262Error()); });
assert.sameValue(
unreachable,
diff --git a/test/built-ins/GeneratorPrototype/throw/try-catch-following-catch.js b/test/built-ins/GeneratorPrototype/throw/try-catch-following-catch.js
index 1866ad20d..1e6912542 100644
--- a/test/built-ins/GeneratorPrototype/throw/try-catch-following-catch.js
+++ b/test/built-ins/GeneratorPrototype/throw/try-catch-following-catch.js
@@ -11,7 +11,6 @@ features: [generators]
var obj = {};
var unreachable = 0;
-
function* g() {
yield 1;
try {
@@ -42,9 +41,7 @@ result = iter.next();
assert.sameValue(result.value, 3, 'Fourth result `value`');
assert.sameValue(result.done, false, 'Fourth result `done` flag');
-assert.throws(Test262Error, function() {
- iter.throw(new Test262Error());
-});
+assert.throws(Test262Error, function() { iter.throw(new Test262Error()); });
assert.sameValue(
unreachable,
diff --git a/test/built-ins/GeneratorPrototype/throw/try-catch-within-catch.js b/test/built-ins/GeneratorPrototype/throw/try-catch-within-catch.js
index 937004428..176b4cc41 100644
--- a/test/built-ins/GeneratorPrototype/throw/try-catch-within-catch.js
+++ b/test/built-ins/GeneratorPrototype/throw/try-catch-within-catch.js
@@ -10,7 +10,6 @@ features: [generators]
---*/
var unreachable = 0;
-
function* g() {
yield 1;
try {
@@ -39,9 +38,7 @@ result = iter.next();
assert.sameValue(result.value, exception, 'Third result `value`');
assert.sameValue(result.done, false, 'Third result `done` flag');
-assert.throws(Test262Error, function() {
- iter.throw(new Test262Error());
-});
+assert.throws(Test262Error, function() { iter.throw(new Test262Error()); });
assert.sameValue(
unreachable,
diff --git a/test/built-ins/GeneratorPrototype/throw/try-catch-within-try.js b/test/built-ins/GeneratorPrototype/throw/try-catch-within-try.js
index e63430ce6..af352ae29 100644
--- a/test/built-ins/GeneratorPrototype/throw/try-catch-within-try.js
+++ b/test/built-ins/GeneratorPrototype/throw/try-catch-within-try.js
@@ -10,7 +10,6 @@ features: [generators]
---*/
var unreachable = 0;
-
function* g() {
yield 1;
try {
diff --git a/test/built-ins/GeneratorPrototype/throw/try-finally-before-try.js b/test/built-ins/GeneratorPrototype/throw/try-finally-before-try.js
index daad602d0..4ecd883b9 100644
--- a/test/built-ins/GeneratorPrototype/throw/try-finally-before-try.js
+++ b/test/built-ins/GeneratorPrototype/throw/try-finally-before-try.js
@@ -10,7 +10,6 @@ features: [generators]
---*/
var unreachable = 0;
-
function* g() {
yield 1;
unreachable += 1;
@@ -34,9 +33,7 @@ assert.sameValue(
unreachable, 0, 'statement following `yield` not executed (paused at yield)'
);
-assert.throws(Test262Error, function() {
- iter.throw(new Test262Error());
-});
+assert.throws(Test262Error, function() { iter.throw(new Test262Error()); });
assert.sameValue(
unreachable,
@@ -48,7 +45,7 @@ result = iter.next();
assert.sameValue(
result.value, undefined, 'Result `value` is undefined when done'
);
-assert.sameValue(result.done, true, 'Result `done` flag is `true` when done');
+assert.sameValue( result.done, true, 'Result `done` flag is `true` when done');
assert.sameValue(
unreachable, 0, 'statement following `yield` not executed (once "completed")'
);
diff --git a/test/built-ins/GeneratorPrototype/throw/try-finally-following-finally.js b/test/built-ins/GeneratorPrototype/throw/try-finally-following-finally.js
index aac9dd130..fdc9fa55d 100644
--- a/test/built-ins/GeneratorPrototype/throw/try-finally-following-finally.js
+++ b/test/built-ins/GeneratorPrototype/throw/try-finally-following-finally.js
@@ -10,7 +10,6 @@ features: [generators]
---*/
var unreachable = 0;
-
function* g() {
yield 1;
try {
@@ -40,9 +39,7 @@ result = iter.next();
assert.sameValue(result.value, 4, 'Third result `value`');
assert.sameValue(result.done, false, 'Third result `done` flag');
-assert.throws(Test262Error, function() {
- iter.throw(new Test262Error());
-});
+assert.throws(Test262Error, function() { iter.throw(new Test262Error()); });
assert.sameValue(
unreachable,
diff --git a/test/built-ins/GeneratorPrototype/throw/try-finally-nested-try-catch-within-catch.js b/test/built-ins/GeneratorPrototype/throw/try-finally-nested-try-catch-within-catch.js
index 16c78fe31..c69d12f42 100644
--- a/test/built-ins/GeneratorPrototype/throw/try-finally-nested-try-catch-within-catch.js
+++ b/test/built-ins/GeneratorPrototype/throw/try-finally-nested-try-catch-within-catch.js
@@ -11,7 +11,6 @@ features: [generators]
---*/
var unreachable = 0;
-
function* g() {
try {
yield 1;
@@ -48,9 +47,7 @@ result = iter.throw(new Test262Error());
assert.sameValue(result.value, 4, 'Fourth result `value`');
assert.sameValue(result.done, false, 'Fourth result `done` flag');
-assert.throws(Test262Error, function() {
- iter.next();
-});
+assert.throws(Test262Error, function() { iter.next(); });
assert.sameValue(
unreachable,
diff --git a/test/built-ins/GeneratorPrototype/throw/try-finally-nested-try-catch-within-finally.js b/test/built-ins/GeneratorPrototype/throw/try-finally-nested-try-catch-within-finally.js
index eb691f39c..8c5392ea7 100644
--- a/test/built-ins/GeneratorPrototype/throw/try-finally-nested-try-catch-within-finally.js
+++ b/test/built-ins/GeneratorPrototype/throw/try-finally-nested-try-catch-within-finally.js
@@ -10,7 +10,6 @@ features: [generators]
---*/
var unreachable = 0;
-
function* g() {
try {
yield 1;
@@ -39,9 +38,7 @@ result = iter.next();
assert.sameValue(result.value, 4, 'Second result `value`');
assert.sameValue(result.done, false, 'First result `done` flag');
-assert.throws(Test262Error, function() {
- iter.throw(new Test262Error());
-});
+assert.throws(Test262Error, function() { iter.throw(new Test262Error()); });
assert.sameValue(
unreachable,
diff --git a/test/built-ins/GeneratorPrototype/throw/try-finally-nested-try-catch-within-inner-try.js b/test/built-ins/GeneratorPrototype/throw/try-finally-nested-try-catch-within-inner-try.js
index 20c833b45..6b0ae2647 100644
--- a/test/built-ins/GeneratorPrototype/throw/try-finally-nested-try-catch-within-inner-try.js
+++ b/test/built-ins/GeneratorPrototype/throw/try-finally-nested-try-catch-within-inner-try.js
@@ -11,7 +11,6 @@ features: [generators]
---*/
var unreachable = 0;
-
function* g() {
try {
yield 1;
diff --git a/test/built-ins/GeneratorPrototype/throw/try-finally-nested-try-catch-within-outer-try-after-nested.js b/test/built-ins/GeneratorPrototype/throw/try-finally-nested-try-catch-within-outer-try-after-nested.js
index cb1c4318b..93c9cbad5 100644
--- a/test/built-ins/GeneratorPrototype/throw/try-finally-nested-try-catch-within-outer-try-after-nested.js
+++ b/test/built-ins/GeneratorPrototype/throw/try-finally-nested-try-catch-within-outer-try-after-nested.js
@@ -11,7 +11,6 @@ features: [generators]
---*/
var unreachable = 0;
-
function* g() {
try {
yield 1;
@@ -58,9 +57,7 @@ assert.sameValue(
'statement following `yield` not executed (following `throw`)'
);
-assert.throws(Test262Error, function() {
- iter.next();
-});
+assert.throws(Test262Error, function() { iter.next(); });
result = iter.next();
assert.sameValue(
diff --git a/test/built-ins/GeneratorPrototype/throw/try-finally-nested-try-catch-within-outer-try-before-nested.js b/test/built-ins/GeneratorPrototype/throw/try-finally-nested-try-catch-within-outer-try-before-nested.js
index 5ce3a0516..942234e3c 100644
--- a/test/built-ins/GeneratorPrototype/throw/try-finally-nested-try-catch-within-outer-try-before-nested.js
+++ b/test/built-ins/GeneratorPrototype/throw/try-finally-nested-try-catch-within-outer-try-before-nested.js
@@ -11,7 +11,6 @@ features: [generators]
---*/
var unreachable = 0;
-
function* g() {
try {
yield 1;
@@ -44,9 +43,7 @@ assert.sameValue(
'statement following `yield` not executed (following `throw`)'
);
-assert.throws(Test262Error, function() {
- iter.next();
-});
+assert.throws(Test262Error, function() { iter.next(); });
result = iter.next();
assert.sameValue(
diff --git a/test/built-ins/GeneratorPrototype/throw/try-finally-within-finally.js b/test/built-ins/GeneratorPrototype/throw/try-finally-within-finally.js
index 628987116..8a83967c5 100644
--- a/test/built-ins/GeneratorPrototype/throw/try-finally-within-finally.js
+++ b/test/built-ins/GeneratorPrototype/throw/try-finally-within-finally.js
@@ -10,7 +10,6 @@ features: [generators]
---*/
var unreachable = 0;
-
function* g() {
yield 1;
try {
@@ -36,9 +35,7 @@ result = iter.next();
assert.sameValue(result.value, 3, 'Third result `value`');
assert.sameValue(result.done, false, 'Third result `done` flag');
-assert.throws(Test262Error, function() {
- iter.throw(new Test262Error());
-});
+assert.throws(Test262Error, function() { iter.throw(new Test262Error()); });
assert.sameValue(
unreachable,
diff --git a/test/built-ins/GeneratorPrototype/throw/try-finally-within-try.js b/test/built-ins/GeneratorPrototype/throw/try-finally-within-try.js
index 91105b8b7..19764d8b7 100644
--- a/test/built-ins/GeneratorPrototype/throw/try-finally-within-try.js
+++ b/test/built-ins/GeneratorPrototype/throw/try-finally-within-try.js
@@ -10,7 +10,6 @@ features: [generators]
---*/
var unreachable = 0;
-
function* g() {
yield 1;
try {
@@ -42,9 +41,7 @@ assert.sameValue(
'statement following `yield` not executed (following `throw`)'
);
-assert.throws(Test262Error, function() {
- iter.next();
-});
+assert.throws(Test262Error, function() { iter.next(); });
result = iter.next();
assert.sameValue(