diff --git a/test/built-ins/GeneratorFunction/extensibility.js b/test/built-ins/GeneratorFunction/extensibility.js index 265cffc02cb8013c9fb8654c1be9baf75744d3bb..4328a904e33b892c34378e6b6eb44a14aebf7a56 100644 --- a/test/built-ins/GeneratorFunction/extensibility.js +++ b/test/built-ins/GeneratorFunction/extensibility.js @@ -10,6 +10,6 @@ info: | features: [generators] ---*/ -var GeneratorFunction = Object.getPrototypeOf(function* () {}).constructor; +var GeneratorFunction = Object.getPrototypeOf(function*() {}).constructor; assert(Object.isExtensible(GeneratorFunction)); diff --git a/test/built-ins/GeneratorFunction/has-instance.js b/test/built-ins/GeneratorFunction/has-instance.js index 80d176b784b6c0bb8d9c385dbeb3e3b8dcdf4661..3b5ad67f80d6aa2951848dcdd13b90845b66605a 100644 --- a/test/built-ins/GeneratorFunction/has-instance.js +++ b/test/built-ins/GeneratorFunction/has-instance.js @@ -8,10 +8,10 @@ description: > features: [generators] ---*/ -var GeneratorFunction = Object.getPrototypeOf(function* () {}).constructor; +var GeneratorFunction = Object.getPrototypeOf(function*() {}).constructor; function* gDecl() {} -var gExpr = function* () {}; +var gExpr = function*() {}; assert( gDecl instanceof GeneratorFunction, diff --git a/test/built-ins/GeneratorFunction/instance-construct-throws.js b/test/built-ins/GeneratorFunction/instance-construct-throws.js index 8225a4776a94ddc9fd1ab0deb07b380438306c78..1cec55dd733268ad7ac36923b33e043155e101ea 100644 --- a/test/built-ins/GeneratorFunction/instance-construct-throws.js +++ b/test/built-ins/GeneratorFunction/instance-construct-throws.js @@ -21,10 +21,10 @@ info: | features: [generators] ---*/ -var GeneratorFunction = Object.getPrototypeOf(function* () {}).constructor; +var GeneratorFunction = Object.getPrototypeOf(function*() {}).constructor; var instance = GeneratorFunction(); assert.throws(TypeError, function() { - new instance(); + new instance(); }) diff --git a/test/built-ins/GeneratorFunction/instance-length.js b/test/built-ins/GeneratorFunction/instance-length.js index fb1389f736f2dde593605cf88e9fe5a933b84750..0951a1a2a306d0479f070e961c008c46640b72ec 100644 --- a/test/built-ins/GeneratorFunction/instance-length.js +++ b/test/built-ins/GeneratorFunction/instance-length.js @@ -25,7 +25,7 @@ includes: [propertyHelper.js] features: [generators] ---*/ -var GeneratorFunction = Object.getPrototypeOf(function* () {}).constructor; +var GeneratorFunction = Object.getPrototypeOf(function*() {}).constructor; assert.sameValue(GeneratorFunction().length, 0); assert.sameValue(GeneratorFunction('').length, 0); diff --git a/test/built-ins/GeneratorFunction/instance-name.js b/test/built-ins/GeneratorFunction/instance-name.js index 5dab8a3124a66e017275f266323424732b8a98b6..88fcd961a3cb9c6fd1c8939c41acf44ae5872433 100644 --- a/test/built-ins/GeneratorFunction/instance-name.js +++ b/test/built-ins/GeneratorFunction/instance-name.js @@ -17,7 +17,7 @@ includes: [propertyHelper.js] features: [generators] ---*/ -var GeneratorFunction = Object.getPrototypeOf(function* () {}).constructor; +var GeneratorFunction = Object.getPrototypeOf(function*() {}).constructor; assert.sameValue(GeneratorFunction().name, 'anonymous'); verifyNotEnumerable(GeneratorFunction(), 'name'); diff --git a/test/built-ins/GeneratorFunction/instance-prototype.js b/test/built-ins/GeneratorFunction/instance-prototype.js index 3f6db037d262f33e06977a0f4dcd335da1304fc4..e542b896405050b12b37a79d3e2ff0dc85a361ec 100644 --- a/test/built-ins/GeneratorFunction/instance-prototype.js +++ b/test/built-ins/GeneratorFunction/instance-prototype.js @@ -21,7 +21,7 @@ includes: [propertyHelper.js] features: [generators] ---*/ -var GeneratorFunction = Object.getPrototypeOf(function* () {}).constructor; +var GeneratorFunction = Object.getPrototypeOf(function*() {}).constructor; var instance = GeneratorFunction(); diff --git a/test/built-ins/GeneratorFunction/instance-yield-expr-in-param.js b/test/built-ins/GeneratorFunction/instance-yield-expr-in-param.js index a04982da887046cd2ba013eba51831795e0981d8..419360a88f4927887e0c73e66ed767e1f7450f8b 100644 --- a/test/built-ins/GeneratorFunction/instance-yield-expr-in-param.js +++ b/test/built-ins/GeneratorFunction/instance-yield-expr-in-param.js @@ -17,7 +17,7 @@ info: | features: [generators] ---*/ -var GeneratorFunction = Object.getPrototypeOf(function* () {}).constructor; +var GeneratorFunction = Object.getPrototypeOf(function*() {}).constructor; // YieldExpression is permitted in function body. GeneratorFunction('x = yield'); diff --git a/test/built-ins/GeneratorFunction/invoked-as-constructor-no-arguments.js b/test/built-ins/GeneratorFunction/invoked-as-constructor-no-arguments.js index cb5bf8e8a98dc2dc9635ad8ce900ecd24d2bce05..564810fa12f38f5b4dbb3df74034e0d4744b0d30 100644 --- a/test/built-ins/GeneratorFunction/invoked-as-constructor-no-arguments.js +++ b/test/built-ins/GeneratorFunction/invoked-as-constructor-no-arguments.js @@ -8,7 +8,7 @@ description: > features: [generators] ---*/ -var GeneratorFunction = Object.getPrototypeOf(function* () {}).constructor; +var GeneratorFunction = Object.getPrototypeOf(function*() {}).constructor; var g = new GeneratorFunction(); var iter = g(); diff --git a/test/built-ins/GeneratorFunction/invoked-as-function-multiple-arguments.js b/test/built-ins/GeneratorFunction/invoked-as-function-multiple-arguments.js index a32adad02a9e61f476c2098c3d052a93a65143f4..7b7ac8429c8f63b1e6dc012a52bf59d594463c0b 100644 --- a/test/built-ins/GeneratorFunction/invoked-as-function-multiple-arguments.js +++ b/test/built-ins/GeneratorFunction/invoked-as-function-multiple-arguments.js @@ -10,7 +10,7 @@ description: > features: [generators] ---*/ -var GeneratorFunction = Object.getPrototypeOf(function* () {}).constructor; +var GeneratorFunction = Object.getPrototypeOf(function*() {}).constructor; var g = GeneratorFunction('x', 'y', 'yield x + y;'); var iter = g(2, 3); diff --git a/test/built-ins/GeneratorFunction/invoked-as-function-no-arguments.js b/test/built-ins/GeneratorFunction/invoked-as-function-no-arguments.js index 928f733744223d8961694d5d4cc70f7917126455..204d5a30b5f9a567975cc570fd5dd6270d487209 100644 --- a/test/built-ins/GeneratorFunction/invoked-as-function-no-arguments.js +++ b/test/built-ins/GeneratorFunction/invoked-as-function-no-arguments.js @@ -8,7 +8,7 @@ description: > features: [generators] ---*/ -var GeneratorFunction = Object.getPrototypeOf(function* () {}).constructor; +var GeneratorFunction = Object.getPrototypeOf(function*() {}).constructor; var g = GeneratorFunction(); var iter = g(); diff --git a/test/built-ins/GeneratorFunction/invoked-as-function-single-argument.js b/test/built-ins/GeneratorFunction/invoked-as-function-single-argument.js index e49ddcbc4e946c5c896558090072ba0d7c473abd..279bfd129f2913c49a94f37594da40ecd2d46d46 100644 --- a/test/built-ins/GeneratorFunction/invoked-as-function-single-argument.js +++ b/test/built-ins/GeneratorFunction/invoked-as-function-single-argument.js @@ -9,7 +9,7 @@ description: > features: [generators] ---*/ -var GeneratorFunction = Object.getPrototypeOf(function* () {}).constructor; +var GeneratorFunction = Object.getPrototypeOf(function*() {}).constructor; var g = GeneratorFunction('yield 1;'); var iter = g(); diff --git a/test/built-ins/GeneratorFunction/length.js b/test/built-ins/GeneratorFunction/length.js index f118d1de613c75eb468d6b03a1a8994a46a04f7b..b989303dece657a9734005262435074492cadd05 100644 --- a/test/built-ins/GeneratorFunction/length.js +++ b/test/built-ins/GeneratorFunction/length.js @@ -10,7 +10,7 @@ includes: [propertyHelper.js] features: [generators] ---*/ -var GeneratorFunction = Object.getPrototypeOf(function* () {}).constructor; +var GeneratorFunction = Object.getPrototypeOf(function*() {}).constructor; assert.sameValue(GeneratorFunction.length, 1); diff --git a/test/built-ins/GeneratorFunction/name.js b/test/built-ins/GeneratorFunction/name.js index 99f02561ca02810d7114fb672b8d439ca9fbc071..2d517748b13a2a53ca98d1efc680ac4827b0d94c 100644 --- a/test/built-ins/GeneratorFunction/name.js +++ b/test/built-ins/GeneratorFunction/name.js @@ -20,7 +20,7 @@ includes: [propertyHelper.js] features: [generators] ---*/ -var GeneratorFunction = Object.getPrototypeOf(function* () {}).constructor; +var GeneratorFunction = Object.getPrototypeOf(function*() {}).constructor; assert.sameValue(GeneratorFunction.name, 'GeneratorFunction'); diff --git a/test/built-ins/GeneratorFunction/proto-from-ctor-realm.js b/test/built-ins/GeneratorFunction/proto-from-ctor-realm.js index b8215acf4ed2db181e79958c0c7b999bf53fa840..313fd4baab8380f246ba535cb9f58ecf07838e20 100644 --- a/test/built-ins/GeneratorFunction/proto-from-ctor-realm.js +++ b/test/built-ins/GeneratorFunction/proto-from-ctor-realm.js @@ -29,10 +29,10 @@ info: | features: [generators, cross-realm, Reflect] ---*/ -var GeneratorFunction = Object.getPrototypeOf(function* () {}).constructor; +var GeneratorFunction = Object.getPrototypeOf(function*() {}).constructor; var other = $262.createRealm().global; var OtherGeneratorFunction = Object.getPrototypeOf( - other.eval('(0, function* () {})') + other.eval('(0, function* () {})') ).constructor; var C = new other.Function(); C.prototype = null; diff --git a/test/built-ins/GeneratorFunction/prototype/constructor.js b/test/built-ins/GeneratorFunction/prototype/constructor.js index 26c4370b14f3169f5806bca4a79a426b06bb0f49..87cb43184424ee0c034b42d18953435dc9f1eb64 100644 --- a/test/built-ins/GeneratorFunction/prototype/constructor.js +++ b/test/built-ins/GeneratorFunction/prototype/constructor.js @@ -15,7 +15,7 @@ includes: [propertyHelper.js] features: [generators] ---*/ -var GeneratorFunction = Object.getPrototypeOf(function* () {}).constructor; +var GeneratorFunction = Object.getPrototypeOf(function*() {}).constructor; assert.sameValue(GeneratorFunction.prototype.constructor, GeneratorFunction); diff --git a/test/built-ins/GeneratorFunction/prototype/extensibility.js b/test/built-ins/GeneratorFunction/prototype/extensibility.js index 4a713476930ffe3ec662337f88ce7efd9f23d1d4..ca9f590996d49941c29d08e9a52c54ae7d12133e 100644 --- a/test/built-ins/GeneratorFunction/prototype/extensibility.js +++ b/test/built-ins/GeneratorFunction/prototype/extensibility.js @@ -10,6 +10,6 @@ info: | features: [generators] ---*/ -var GeneratorFunction = Object.getPrototypeOf(function* () {}).constructor; +var GeneratorFunction = Object.getPrototypeOf(function*() {}).constructor; assert(Object.isExtensible(GeneratorFunction.prototype)); diff --git a/test/built-ins/GeneratorFunction/prototype/prop-desc.js b/test/built-ins/GeneratorFunction/prototype/prop-desc.js index 1ba38ae8aaf7cfa064ad869b15d187d321860368..e28a1d04bbad5e6e8a462583f6ca8549ae23794f 100644 --- a/test/built-ins/GeneratorFunction/prototype/prop-desc.js +++ b/test/built-ins/GeneratorFunction/prototype/prop-desc.js @@ -10,7 +10,7 @@ includes: [propertyHelper.js] features: [generators] ---*/ -var GeneratorFunction = Object.getPrototypeOf(function* () {}).constructor; +var GeneratorFunction = Object.getPrototypeOf(function*() {}).constructor; verifyNotEnumerable(GeneratorFunction, 'prototype'); verifyNotWritable(GeneratorFunction, 'prototype'); diff --git a/test/built-ins/GeneratorPrototype/next/consecutive-yields.js b/test/built-ins/GeneratorPrototype/next/consecutive-yields.js index 3f6332163c92d63a4c1ee3c46b2e527d36f05fab..3986c63d0f165df5be9423681a3ac62a5b40e267 100644 --- a/test/built-ins/GeneratorPrototype/next/consecutive-yields.js +++ b/test/built-ins/GeneratorPrototype/next/consecutive-yields.js @@ -8,7 +8,10 @@ description: > features: [generators] ---*/ -function* g() { yield 1; yield 2; } +function* g() { + yield 1; + yield 2; +} var iter = g(); var result; diff --git a/test/built-ins/GeneratorPrototype/next/context-method-invocation.js b/test/built-ins/GeneratorPrototype/next/context-method-invocation.js index 5e6f3ed5a53adcf5a564d428f84693e2f5fc6d1c..aff5667ad8f0de997063d8e5d666b2419db5218e 100644 --- a/test/built-ins/GeneratorPrototype/next/context-method-invocation.js +++ b/test/built-ins/GeneratorPrototype/next/context-method-invocation.js @@ -9,8 +9,13 @@ features: [generators] ---*/ var context; -function* g() { context = this; } -var obj = { g: g }; + +function* g() { + context = this; +} +var obj = { + g: g +}; var iter = obj.g(); iter.next(); diff --git a/test/built-ins/GeneratorPrototype/next/from-state-executing.js b/test/built-ins/GeneratorPrototype/next/from-state-executing.js index 29461cc1175f88aca7239037d89c3ac13d22f542..2a05f8c2f7aaea5cc1d5a95e710f36711f538d18 100644 --- a/test/built-ins/GeneratorPrototype/next/from-state-executing.js +++ b/test/built-ins/GeneratorPrototype/next/from-state-executing.js @@ -37,9 +37,11 @@ features: [generators] ---*/ var iter, result; + function* withoutVal() { iter.next(); } + function* withVal() { iter.next(42); } diff --git a/test/built-ins/GeneratorPrototype/next/lone-return.js b/test/built-ins/GeneratorPrototype/next/lone-return.js index cae93289b439c393c61ca84fa4b2c769cda7a584..0a444cbc14f94075d1e26e1b13c5d768f8e58550 100644 --- a/test/built-ins/GeneratorPrototype/next/lone-return.js +++ b/test/built-ins/GeneratorPrototype/next/lone-return.js @@ -8,7 +8,9 @@ description: > features: [generators] ---*/ -function* g() { return 23; } +function* g() { + return 23; +} var iter = g(); var result; diff --git a/test/built-ins/GeneratorPrototype/next/lone-yield.js b/test/built-ins/GeneratorPrototype/next/lone-yield.js index 76199c672100f8367bef497aba671dc2546583b3..c909af148039042ef6ed4d20e9d41195a3655eb3 100644 --- a/test/built-ins/GeneratorPrototype/next/lone-yield.js +++ b/test/built-ins/GeneratorPrototype/next/lone-yield.js @@ -8,7 +8,9 @@ description: > features: [generators] ---*/ -function* g() { yield 1; } +function* g() { + yield 1; +} var iter = g(); var result; diff --git a/test/built-ins/GeneratorPrototype/next/this-val-not-generator.js b/test/built-ins/GeneratorPrototype/next/this-val-not-generator.js index dee7dfc4efa8f3ddc1c097d282b2b47bcfb2c1aa..25727d062d4a42fa546df5b63ab4b447f0a471df 100644 --- a/test/built-ins/GeneratorPrototype/next/this-val-not-generator.js +++ b/test/built-ins/GeneratorPrototype/next/this-val-not-generator.js @@ -27,44 +27,60 @@ var GeneratorPrototype = Object.getPrototypeOf(g).prototype; assert.throws( TypeError, - function() { GeneratorPrototype.next.call({}); }, + function() { + GeneratorPrototype.next.call({}); + }, 'ordinary object (without value)' ); assert.throws( TypeError, - function() { GeneratorPrototype.next.call({}, 1); }, + function() { + GeneratorPrototype.next.call({}, 1); + }, 'ordinary object (with value)' ); assert.throws( TypeError, - function() { GeneratorPrototype.next.call(function() {}); }, + function() { + GeneratorPrototype.next.call(function() {}); + }, 'function object (without value)' ); assert.throws( TypeError, - function() { GeneratorPrototype.next.call(function() {}, 1); }, + function() { + GeneratorPrototype.next.call(function() {}, 1); + }, 'function object (with value)' ); assert.throws( TypeError, - function() { GeneratorPrototype.next.call(g); }, + function() { + GeneratorPrototype.next.call(g); + }, 'generator function object (without value)' ); assert.throws( TypeError, - function() { GeneratorPrototype.next.call(g, 1); }, + function() { + GeneratorPrototype.next.call(g, 1); + }, 'generator function object (with value)' ); assert.throws( TypeError, - function() { GeneratorPrototype.next.call(g.prototype); }, + function() { + GeneratorPrototype.next.call(g.prototype); + }, 'generator function prototype object (without value)' ); assert.throws( TypeError, - function() { GeneratorPrototype.next.call(g.prototype, 1); }, + function() { + GeneratorPrototype.next.call(g.prototype, 1); + }, 'generator function prototype object (with value)' ); diff --git a/test/built-ins/GeneratorPrototype/next/this-val-not-object.js b/test/built-ins/GeneratorPrototype/next/this-val-not-object.js index 646590b6fed75f2470f2dc6aca4bb85ed1e84d50..c42b5777f0f0f80f5d3ba4ea9702d0bc036b96c4 100644 --- a/test/built-ins/GeneratorPrototype/next/this-val-not-object.js +++ b/test/built-ins/GeneratorPrototype/next/this-val-not-object.js @@ -26,66 +26,90 @@ var symbol = Symbol(); assert.throws( TypeError, - function() { GeneratorPrototype.next.call(undefined); }, + function() { + GeneratorPrototype.next.call(undefined); + }, 'undefined (without value)' ); assert.throws( TypeError, - function() { GeneratorPrototype.next.call(undefined, 1); }, + function() { + GeneratorPrototype.next.call(undefined, 1); + }, 'undefined (with value)' ); assert.throws( TypeError, - function() { GeneratorPrototype.next.call(null); }, + function() { + GeneratorPrototype.next.call(null); + }, 'null (without value)' ); assert.throws( TypeError, - function() { GeneratorPrototype.next.call(null, 1); }, + function() { + GeneratorPrototype.next.call(null, 1); + }, 'null (with value)' ); assert.throws( TypeError, - function() { GeneratorPrototype.next.call(true); }, + function() { + GeneratorPrototype.next.call(true); + }, 'boolean (without value)' ); assert.throws( TypeError, - function() { GeneratorPrototype.next.call(true, 1); }, + function() { + GeneratorPrototype.next.call(true, 1); + }, 'boolean (with value)' ); assert.throws( TypeError, - function() { GeneratorPrototype.next.call('s'); }, + function() { + GeneratorPrototype.next.call('s'); + }, 'string (without value)' ); assert.throws( TypeError, - function() { GeneratorPrototype.next.call('s', 1); }, + function() { + GeneratorPrototype.next.call('s', 1); + }, 'string (with value)' ); assert.throws( TypeError, - function() { GeneratorPrototype.next.call(1); }, + function() { + GeneratorPrototype.next.call(1); + }, 'number (without value)' ); assert.throws( TypeError, - function() { GeneratorPrototype.next.call(1, 1); }, + function() { + GeneratorPrototype.next.call(1, 1); + }, 'number (with value)' ); assert.throws( TypeError, - function() { GeneratorPrototype.next.call(symbol); }, + function() { + GeneratorPrototype.next.call(symbol); + }, 'symbol (without value)' ); assert.throws( TypeError, - function() { GeneratorPrototype.next.call(symbol, 1); }, + function() { + GeneratorPrototype.next.call(symbol, 1); + }, 'symbol (with value)' ); 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 1af04d29960f35d95c95a8d36ae779247a36108b..dd0ff4b332d5216ad58371e46602db901068acf0 100644 --- a/test/built-ins/GeneratorPrototype/return/this-val-not-generator.js +++ b/test/built-ins/GeneratorPrototype/return/this-val-not-generator.js @@ -27,44 +27,60 @@ 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 edf0b124ed4ea91249854428e0608f9c9e974f56..c8431b407c14320c0f41c92e0f8e6dc74eeef0ee 100644 --- a/test/built-ins/GeneratorPrototype/return/this-val-not-object.js +++ b/test/built-ins/GeneratorPrototype/return/this-val-not-object.js @@ -26,66 +26,90 @@ 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-finally-before-try.js b/test/built-ins/GeneratorPrototype/return/try-finally-before-try.js index 1f1522fbb812eba6ee8da99f495089dd45c59916..24be6db3c5945b5496b72ce47a149b2ee1dad7e9 100644 --- a/test/built-ins/GeneratorPrototype/return/try-finally-before-try.js +++ b/test/built-ins/GeneratorPrototype/return/try-finally-before-try.js @@ -10,12 +10,11 @@ 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 9066852be2d1890342f69e1110c253ed9fda09cf..665e968b4600d47f0ecb4f972191f2529e87953b 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-finally.js b/test/built-ins/GeneratorPrototype/return/try-finally-nested-try-catch-within-finally.js index 42ff56701b039bc03583c240a9a0777398efe796..6bfef0e3042eb2f2456376f941d34ed845fd9795 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-outer-try-after-nested.js b/test/built-ins/GeneratorPrototype/return/try-finally-nested-try-catch-within-outer-try-after-nested.js index 2342f69a60ddaf79679bd265700491255def4408..5e056c140c62bc4125f43c9248715e741d979185 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,6 +13,7 @@ features: [generators] var inCatch = 0; var inFinally = 0; var unreachable = 0; + function* g() { try { try { @@ -29,7 +30,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-within-finally.js b/test/built-ins/GeneratorPrototype/return/try-finally-within-finally.js index 4ea893dc3427ff7a8ad5b808b0e0707afbc3db2a..fbec889d98d57287910d3e0b271e9c06981dcc2d 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/throw/from-state-completed.js b/test/built-ins/GeneratorPrototype/throw/from-state-completed.js index 3d8e6cbf5ddbfa99d7037064f4b45a04372c299c..209ab9fed56995d050448eb901629a5bb7712677 100644 --- a/test/built-ins/GeneratorPrototype/throw/from-state-completed.js +++ b/test/built-ins/GeneratorPrototype/throw/from-state-completed.js @@ -9,13 +9,16 @@ 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-suspended-start.js b/test/built-ins/GeneratorPrototype/throw/from-state-suspended-start.js index 53d44904e5a4e0c08449f8e520a91a299e74ee75..3bf6296c356d9f62fda7e500f85876c1a516d417 100644 --- a/test/built-ins/GeneratorPrototype/throw/from-state-suspended-start.js +++ b/test/built-ins/GeneratorPrototype/throw/from-state-suspended-start.js @@ -10,6 +10,7 @@ features: [generators] ---*/ function E() {} + function* G() { yield 1; yield 2; @@ -17,7 +18,9 @@ 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 8667ad89796568fc10b4990f2afa36739f9d1c83..fae6fe7b75e814921effb403a2fec728ee774f55 100644 --- a/test/built-ins/GeneratorPrototype/throw/this-val-not-generator.js +++ b/test/built-ins/GeneratorPrototype/throw/this-val-not-generator.js @@ -27,44 +27,60 @@ 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 8b4d342be2602f484ebce287bc9002ea2d1dbeaf..8122f2b3823fbc9a0ce79decb71b9344ca6bc327 100644 --- a/test/built-ins/GeneratorPrototype/throw/this-val-not-object.js +++ b/test/built-ins/GeneratorPrototype/throw/this-val-not-object.js @@ -26,66 +26,90 @@ 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 bfd3086c7a384f96f953087eea2230ee9e49a78f..bc2707e5c84d7d9bd4314beb851febd0f526c53e 100644 --- a/test/built-ins/GeneratorPrototype/throw/try-catch-before-try.js +++ b/test/built-ins/GeneratorPrototype/throw/try-catch-before-try.js @@ -10,6 +10,7 @@ features: [generators] ---*/ var unreachable = 0; + function* g() { yield 1; unreachable += 1; @@ -31,7 +32,9 @@ 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 1e69125421ef551dc68b922f683b57735c2a07d7..1866ad20dceb0264181e37627bc7b5f6558b20dd 100644 --- a/test/built-ins/GeneratorPrototype/throw/try-catch-following-catch.js +++ b/test/built-ins/GeneratorPrototype/throw/try-catch-following-catch.js @@ -11,6 +11,7 @@ features: [generators] var obj = {}; var unreachable = 0; + function* g() { yield 1; try { @@ -41,7 +42,9 @@ 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 176b4cc4126453cfa26e295636b6b21e45fa191b..93700442876a6747c11d5455f9b422244e81609c 100644 --- a/test/built-ins/GeneratorPrototype/throw/try-catch-within-catch.js +++ b/test/built-ins/GeneratorPrototype/throw/try-catch-within-catch.js @@ -10,6 +10,7 @@ features: [generators] ---*/ var unreachable = 0; + function* g() { yield 1; try { @@ -38,7 +39,9 @@ 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-finally-before-try.js b/test/built-ins/GeneratorPrototype/throw/try-finally-before-try.js index 4ecd883b9b68598908058ec0cb7d5617207c1d71..daad602d03736ebdd7d224573985a85a31d4d1b9 100644 --- a/test/built-ins/GeneratorPrototype/throw/try-finally-before-try.js +++ b/test/built-ins/GeneratorPrototype/throw/try-finally-before-try.js @@ -10,6 +10,7 @@ features: [generators] ---*/ var unreachable = 0; + function* g() { yield 1; unreachable += 1; @@ -33,7 +34,9 @@ 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, @@ -45,7 +48,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 fdc9fa55d2c6c3dc9a72a51a75b30b8387f481b1..aac9dd1309739392712a4291c4770facc2fabc4f 100644 --- a/test/built-ins/GeneratorPrototype/throw/try-finally-following-finally.js +++ b/test/built-ins/GeneratorPrototype/throw/try-finally-following-finally.js @@ -10,6 +10,7 @@ features: [generators] ---*/ var unreachable = 0; + function* g() { yield 1; try { @@ -39,7 +40,9 @@ 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 c69d12f424ae4cbdf838e38005b6e28035e50e19..16c78fe31348db022c647b178787961301c0a20d 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,6 +11,7 @@ features: [generators] ---*/ var unreachable = 0; + function* g() { try { yield 1; @@ -47,7 +48,9 @@ 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 8c5392ea7afea2b12f3fe5491378db9568f6965c..eb691f39ce439f4f4f0fb33aeeb401cfb8c721e5 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,6 +10,7 @@ features: [generators] ---*/ var unreachable = 0; + function* g() { try { yield 1; @@ -38,7 +39,9 @@ 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-outer-try-after-nested.js b/test/built-ins/GeneratorPrototype/throw/try-finally-nested-try-catch-within-outer-try-after-nested.js index 93c9cbad5e6d179f355b8d8dc704894fd637241a..cb1c4318b4f49581e93e7a5353c5015526b83273 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,6 +11,7 @@ features: [generators] ---*/ var unreachable = 0; + function* g() { try { yield 1; @@ -57,7 +58,9 @@ 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 942234e3ccc64e76d0caebb27006571d5ce5ee96..5ce3a05164738b56031fa8dceb849c66ad34f6f5 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,6 +11,7 @@ features: [generators] ---*/ var unreachable = 0; + function* g() { try { yield 1; @@ -43,7 +44,9 @@ 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 8a83967c56ec05ac0cb3717224df38fbe0c2fa4e..62898711670b5e684731059dbcc99510b2108854 100644 --- a/test/built-ins/GeneratorPrototype/throw/try-finally-within-finally.js +++ b/test/built-ins/GeneratorPrototype/throw/try-finally-within-finally.js @@ -10,6 +10,7 @@ features: [generators] ---*/ var unreachable = 0; + function* g() { yield 1; try { @@ -35,7 +36,9 @@ 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 19764d8b7b5898d9b356268ef96f1c2adde7da5f..91105b8b70ccdcf5f3c1a890040a1bc80376dfb5 100644 --- a/test/built-ins/GeneratorPrototype/throw/try-finally-within-try.js +++ b/test/built-ins/GeneratorPrototype/throw/try-finally-within-try.js @@ -10,6 +10,7 @@ features: [generators] ---*/ var unreachable = 0; + function* g() { yield 1; try { @@ -41,7 +42,9 @@ 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(