Skip to content

Commit

Permalink
Replace runningNatively flag with more reliable runningInTranslation.
Browse files Browse the repository at this point in the history
Closes #106.
  • Loading branch information
benjamn committed Apr 9, 2014
1 parent 82e5568 commit 2c7aa47
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions test/tests.es6.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@
*/

var assert = require("assert");
var runningNatively = false;
try {
runningNatively = !!Function("return function*(){}")();
} catch (e) {}
var runningInTranslation = /\bwrapGenerator\b/.test(function*(){});

function check(g, yields, returnValue) {
for (var i = 0; i < yields.length; ++i) {
Expand Down Expand Up @@ -134,7 +131,7 @@ describe("collatz generator", function() {
});

describe("throw", function() {
(runningNatively ? xit : it)("should complete generator", function() {
(runningInTranslation ? it : xit)("should complete generator", function() {
function *gen(x) {
throw 1;
}
Expand Down Expand Up @@ -1109,7 +1106,7 @@ describe("object literals with multiple yields", function() {
});

describe("generator .throw method", function() {
(runningNatively ? xit : it)("should complete generator", function() {
(runningInTranslation ? it : xit)("should complete generator", function() {
function *gen(x) {
yield 2;
throw 1;
Expand Down

0 comments on commit 2c7aa47

Please sign in to comment.