summaryrefslogtreecommitdiff
path: root/test/built-ins/GeneratorPrototype/return
diff options
context:
space:
mode:
Diffstat (limited to 'test/built-ins/GeneratorPrototype/return')
-rw-r--r--test/built-ins/GeneratorPrototype/return/from-state-executing.js1
-rw-r--r--test/built-ins/GeneratorPrototype/return/from-state-suspended-start.js1
-rw-r--r--test/built-ins/GeneratorPrototype/return/this-val-not-generator.js32
-rw-r--r--test/built-ins/GeneratorPrototype/return/this-val-not-object.js48
-rw-r--r--test/built-ins/GeneratorPrototype/return/try-catch-before-try.js1
-rw-r--r--test/built-ins/GeneratorPrototype/return/try-catch-following-catch.js1
-rw-r--r--test/built-ins/GeneratorPrototype/return/try-catch-within-catch.js1
-rw-r--r--test/built-ins/GeneratorPrototype/return/try-catch-within-try.js1
-rw-r--r--test/built-ins/GeneratorPrototype/return/try-finally-before-try.js5
-rw-r--r--test/built-ins/GeneratorPrototype/return/try-finally-following-finally.js4
-rw-r--r--test/built-ins/GeneratorPrototype/return/try-finally-nested-try-catch-within-catch.js1
-rw-r--r--test/built-ins/GeneratorPrototype/return/try-finally-nested-try-catch-within-finally.js4
-rw-r--r--test/built-ins/GeneratorPrototype/return/try-finally-nested-try-catch-within-inner-try.js1
-rw-r--r--test/built-ins/GeneratorPrototype/return/try-finally-nested-try-catch-within-outer-try-after-nested.js3
-rw-r--r--test/built-ins/GeneratorPrototype/return/try-finally-nested-try-catch-within-outer-try-before-nested.js1
-rw-r--r--test/built-ins/GeneratorPrototype/return/try-finally-within-finally.js4
-rw-r--r--test/built-ins/GeneratorPrototype/return/try-finally-within-try.js1
17 files changed, 30 insertions, 80 deletions
diff --git a/test/built-ins/GeneratorPrototype/return/from-state-executing.js b/test/built-ins/GeneratorPrototype/return/from-state-executing.js
index 203c1a746..9cf5a78bd 100644
--- a/test/built-ins/GeneratorPrototype/return/from-state-executing.js
+++ b/test/built-ins/GeneratorPrototype/return/from-state-executing.js
@@ -37,7 +37,6 @@ features: [generators]
---*/
var iter, result;
-
function* g() {
iter.return(42);
}
diff --git a/test/built-ins/GeneratorPrototype/return/from-state-suspended-start.js b/test/built-ins/GeneratorPrototype/return/from-state-suspended-start.js
index 34e6eebfb..b20ad0aed 100644
--- a/test/built-ins/GeneratorPrototype/return/from-state-suspended-start.js
+++ b/test/built-ins/GeneratorPrototype/return/from-state-suspended-start.js
@@ -10,7 +10,6 @@ features: [generators]
---*/
var bodyCount = 0;
-
function* G() {
bodyCount += 1;
}
diff --git a/test/built-ins/GeneratorPrototype/return/this-val-not-generator.js b/test/built-ins/GeneratorPrototype/return/this-val-not-generator.js
index dd0ff4b33..1af04d299 100644
--- a/test/built-ins/GeneratorPrototype/return/this-val-not-generator.js
+++ b/test/built-ins/GeneratorPrototype/return/this-val-not-generator.js
@@ -27,60 +27,44 @@ var GeneratorPrototype = Object.getPrototypeOf(g).prototype;
assert.throws(
TypeError,
- function() {
- GeneratorPrototype.return.call({});
- },
+ function() { GeneratorPrototype.return.call({}); },
'ordinary object (without value)'
);
assert.throws(
TypeError,
- function() {
- GeneratorPrototype.return.call({}, 1);
- },
+ function() { GeneratorPrototype.return.call({}, 1); },
'ordinary object (with value)'
);
assert.throws(
TypeError,
- function() {
- GeneratorPrototype.return.call(function() {});
- },
+ function() { GeneratorPrototype.return.call(function() {}); },
'function object (without value)'
);
assert.throws(
TypeError,
- function() {
- GeneratorPrototype.return.call(function() {}, 1);
- },
+ function() { GeneratorPrototype.return.call(function() {}, 1); },
'function object (with value)'
);
assert.throws(
TypeError,
- function() {
- GeneratorPrototype.return.call(g);
- },
+ function() { GeneratorPrototype.return.call(g); },
'generator function object (without value)'
);
assert.throws(
TypeError,
- function() {
- GeneratorPrototype.return.call(g, 1);
- },
+ function() { GeneratorPrototype.return.call(g, 1); },
'generator function object (with value)'
);
assert.throws(
TypeError,
- function() {
- GeneratorPrototype.return.call(g.prototype);
- },
+ function() { GeneratorPrototype.return.call(g.prototype); },
'generator function prototype object (without value)'
);
assert.throws(
TypeError,
- function() {
- GeneratorPrototype.return.call(g.prototype, 1);
- },
+ function() { GeneratorPrototype.return.call(g.prototype, 1); },
'generator function prototype object (with value)'
);
diff --git a/test/built-ins/GeneratorPrototype/return/this-val-not-object.js b/test/built-ins/GeneratorPrototype/return/this-val-not-object.js
index c8431b407..edf0b124e 100644
--- a/test/built-ins/GeneratorPrototype/return/this-val-not-object.js
+++ b/test/built-ins/GeneratorPrototype/return/this-val-not-object.js
@@ -26,90 +26,66 @@ var symbol = Symbol();
assert.throws(
TypeError,
- function() {
- GeneratorPrototype.return.call(undefined);
- },
+ function() { GeneratorPrototype.return.call(undefined); },
'undefined (without value)'
);
assert.throws(
TypeError,
- function() {
- GeneratorPrototype.return.call(undefined, 1);
- },
+ function() { GeneratorPrototype.return.call(undefined, 1); },
'undefined (with value)'
);
assert.throws(
TypeError,
- function() {
- GeneratorPrototype.return.call(null);
- },
+ function() { GeneratorPrototype.return.call(null); },
'null (without value)'
);
assert.throws(
TypeError,
- function() {
- GeneratorPrototype.return.call(null, 1);
- },
+ function() { GeneratorPrototype.return.call(null, 1); },
'null (with value)'
);
assert.throws(
TypeError,
- function() {
- GeneratorPrototype.return.call(true);
- },
+ function() { GeneratorPrototype.return.call(true); },
'boolean (without value)'
);
assert.throws(
TypeError,
- function() {
- GeneratorPrototype.return.call(true, 1);
- },
+ function() { GeneratorPrototype.return.call(true, 1); },
'boolean (with value)'
);
assert.throws(
TypeError,
- function() {
- GeneratorPrototype.return.call('s');
- },
+ function() { GeneratorPrototype.return.call('s'); },
'string (without value)'
);
assert.throws(
TypeError,
- function() {
- GeneratorPrototype.return.call('s', 1);
- },
+ function() { GeneratorPrototype.return.call('s', 1); },
'string (with value)'
);
assert.throws(
TypeError,
- function() {
- GeneratorPrototype.return.call(1);
- },
+ function() { GeneratorPrototype.return.call(1); },
'number (without value)'
);
assert.throws(
TypeError,
- function() {
- GeneratorPrototype.return.call(1, 1);
- },
+ function() { GeneratorPrototype.return.call(1, 1); },
'number (with value)'
);
assert.throws(
TypeError,
- function() {
- GeneratorPrototype.return.call(symbol);
- },
+ function() { GeneratorPrototype.return.call(symbol); },
'symbol (without value)'
);
assert.throws(
TypeError,
- function() {
- GeneratorPrototype.return.call(symbol, 1);
- },
+ function() { GeneratorPrototype.return.call(symbol, 1); },
'symbol (with value)'
);
diff --git a/test/built-ins/GeneratorPrototype/return/try-catch-before-try.js b/test/built-ins/GeneratorPrototype/return/try-catch-before-try.js
index d7c40026d..f1b1bdc44 100644
--- a/test/built-ins/GeneratorPrototype/return/try-catch-before-try.js
+++ b/test/built-ins/GeneratorPrototype/return/try-catch-before-try.js
@@ -10,7 +10,6 @@ features: [generators]
---*/
var unreachable = 0;
-
function* g() {
yield;
try {
diff --git a/test/built-ins/GeneratorPrototype/return/try-catch-following-catch.js b/test/built-ins/GeneratorPrototype/return/try-catch-following-catch.js
index b7880cea8..f354530be 100644
--- a/test/built-ins/GeneratorPrototype/return/try-catch-following-catch.js
+++ b/test/built-ins/GeneratorPrototype/return/try-catch-following-catch.js
@@ -11,7 +11,6 @@ features: [generators]
var afterCatch = 0;
var unreachable = 0;
-
function* g() {
try {
throw new Error();
diff --git a/test/built-ins/GeneratorPrototype/return/try-catch-within-catch.js b/test/built-ins/GeneratorPrototype/return/try-catch-within-catch.js
index a995017d2..16c9573f6 100644
--- a/test/built-ins/GeneratorPrototype/return/try-catch-within-catch.js
+++ b/test/built-ins/GeneratorPrototype/return/try-catch-within-catch.js
@@ -11,7 +11,6 @@ features: [generators]
var inCatch = 0;
var unreachable = 0;
-
function* g() {
try {
throw new Error();
diff --git a/test/built-ins/GeneratorPrototype/return/try-catch-within-try.js b/test/built-ins/GeneratorPrototype/return/try-catch-within-try.js
index 2d86cb3bf..3e925ba10 100644
--- a/test/built-ins/GeneratorPrototype/return/try-catch-within-try.js
+++ b/test/built-ins/GeneratorPrototype/return/try-catch-within-try.js
@@ -11,7 +11,6 @@ features: [generators]
var inTry = 0;
var unreachable = 0;
-
function* g() {
try {
inTry += 1;
diff --git a/test/built-ins/GeneratorPrototype/return/try-finally-before-try.js b/test/built-ins/GeneratorPrototype/return/try-finally-before-try.js
index 24be6db3c..1f1522fbb 100644
--- a/test/built-ins/GeneratorPrototype/return/try-finally-before-try.js
+++ b/test/built-ins/GeneratorPrototype/return/try-finally-before-try.js
@@ -10,11 +10,12 @@ features: [generators]
---*/
var unreachable = 0;
-
function* g() {
yield;
unreachable += 1;
- try {} finally {}
+ try {
+ } finally {
+ }
}
var iter = g();
var result;
diff --git a/test/built-ins/GeneratorPrototype/return/try-finally-following-finally.js b/test/built-ins/GeneratorPrototype/return/try-finally-following-finally.js
index 665e968b4..9066852be 100644
--- a/test/built-ins/GeneratorPrototype/return/try-finally-following-finally.js
+++ b/test/built-ins/GeneratorPrototype/return/try-finally-following-finally.js
@@ -11,9 +11,9 @@ features: [generators]
var afterFinally = 0;
var unreachable = 0;
-
function* g() {
- try {} finally {}
+ try {
+ } finally {}
afterFinally += 1;
yield;
unreachable += 1;
diff --git a/test/built-ins/GeneratorPrototype/return/try-finally-nested-try-catch-within-catch.js b/test/built-ins/GeneratorPrototype/return/try-finally-nested-try-catch-within-catch.js
index 937a0bd28..25e1c134e 100644
--- a/test/built-ins/GeneratorPrototype/return/try-finally-nested-try-catch-within-catch.js
+++ b/test/built-ins/GeneratorPrototype/return/try-finally-nested-try-catch-within-catch.js
@@ -13,7 +13,6 @@ features: [generators]
var inCatch = 0;
var inFinally = 0;
var unreachable = 0;
-
function* g() {
try {
try {
diff --git a/test/built-ins/GeneratorPrototype/return/try-finally-nested-try-catch-within-finally.js b/test/built-ins/GeneratorPrototype/return/try-finally-nested-try-catch-within-finally.js
index 6bfef0e30..42ff56701 100644
--- a/test/built-ins/GeneratorPrototype/return/try-finally-nested-try-catch-within-finally.js
+++ b/test/built-ins/GeneratorPrototype/return/try-finally-nested-try-catch-within-finally.js
@@ -11,11 +11,11 @@ features: [generators]
var inFinally = 0;
var unreachable = 0;
-
function* g() {
try {
throw new Error();
- try {} catch (e) {}
+ try {
+ } catch (e) {}
} finally {
inFinally += 1;
yield;
diff --git a/test/built-ins/GeneratorPrototype/return/try-finally-nested-try-catch-within-inner-try.js b/test/built-ins/GeneratorPrototype/return/try-finally-nested-try-catch-within-inner-try.js
index 9d8d5b6ae..8cb4b6ba1 100644
--- a/test/built-ins/GeneratorPrototype/return/try-finally-nested-try-catch-within-inner-try.js
+++ b/test/built-ins/GeneratorPrototype/return/try-finally-nested-try-catch-within-inner-try.js
@@ -13,7 +13,6 @@ features: [generators]
var inTry = 0;
var inFinally = 0;
var unreachable = 0;
-
function* g() {
try {
try {
diff --git a/test/built-ins/GeneratorPrototype/return/try-finally-nested-try-catch-within-outer-try-after-nested.js b/test/built-ins/GeneratorPrototype/return/try-finally-nested-try-catch-within-outer-try-after-nested.js
index 5e056c140..2342f69a6 100644
--- a/test/built-ins/GeneratorPrototype/return/try-finally-nested-try-catch-within-outer-try-after-nested.js
+++ b/test/built-ins/GeneratorPrototype/return/try-finally-nested-try-catch-within-outer-try-after-nested.js
@@ -13,7 +13,6 @@ features: [generators]
var inCatch = 0;
var inFinally = 0;
var unreachable = 0;
-
function* g() {
try {
try {
@@ -30,7 +29,7 @@ function* g() {
var iter = g();
var result;
-iter.next();
+ iter.next();
assert.sameValue(inCatch, 1, '`catch` code path executed');
assert.sameValue(inFinally, 1, '`finally` code path executed');
diff --git a/test/built-ins/GeneratorPrototype/return/try-finally-nested-try-catch-within-outer-try-before-nested.js b/test/built-ins/GeneratorPrototype/return/try-finally-nested-try-catch-within-outer-try-before-nested.js
index 7121ebd77..f97d9bb48 100644
--- a/test/built-ins/GeneratorPrototype/return/try-finally-nested-try-catch-within-outer-try-before-nested.js
+++ b/test/built-ins/GeneratorPrototype/return/try-finally-nested-try-catch-within-outer-try-before-nested.js
@@ -13,7 +13,6 @@ features: [generators]
var inTry = 0;
var inFinally = 0;
var unreachable = 0;
-
function* g() {
try {
inTry += 1;
diff --git a/test/built-ins/GeneratorPrototype/return/try-finally-within-finally.js b/test/built-ins/GeneratorPrototype/return/try-finally-within-finally.js
index fbec889d9..4ea893dc3 100644
--- a/test/built-ins/GeneratorPrototype/return/try-finally-within-finally.js
+++ b/test/built-ins/GeneratorPrototype/return/try-finally-within-finally.js
@@ -11,9 +11,9 @@ features: [generators]
var inFinally = 0;
var unreachable = 0;
-
function* g() {
- try {} finally {
+ try {
+ } finally {
inFinally += 1;
yield;
unreachable += 1;
diff --git a/test/built-ins/GeneratorPrototype/return/try-finally-within-try.js b/test/built-ins/GeneratorPrototype/return/try-finally-within-try.js
index 336c0389b..5b0dce6ef 100644
--- a/test/built-ins/GeneratorPrototype/return/try-finally-within-try.js
+++ b/test/built-ins/GeneratorPrototype/return/try-finally-within-try.js
@@ -12,7 +12,6 @@ features: [generators]
var inTry = 0;
var inFinally = 0;
var unreachable = 0;
-
function* g() {
try {
inTry += 1;