|
@@ -65,16 +65,18 @@ function _collector(result) { return function() { result.push.apply(result, argu
|
|
|
@example
|
|
|
collectYield(function () {for (var p in object) { if (object.hasOwnProperty(p) yield p; }});
|
|
|
*/
|
|
|
-function collectYield(f) {
|
|
|
+
|
|
|
var result = [];
|
|
|
var gen = f();
|
|
|
try {
|
|
|
for(;;) { result.push(gen.next()); }
|
|
|
- } catch (ex if ex instanceof StopIteration) {
|
|
|
-
|
|
|
+ } catch (ex) {
|
|
|
+ if (ex instanceof StopIteration) {
|
|
|
+
|
|
|
+ } else throw ex;
|
|
|
}
|
|
|
return result;
|
|
|
-}
|
|
|
+}*/
|
|
|
|
|
|
|
|
|
|
|
@@ -178,8 +180,10 @@ page.testSuite = [
|
|
|
try {
|
|
|
_l.collectPrint(f);
|
|
|
fail("Exception not thrown");
|
|
|
- } catch(ex if ex === "exception") {
|
|
|
-
|
|
|
+ } catch(ex) {
|
|
|
+ if (ex === "exception") {
|
|
|
+
|
|
|
+ } else throw ex;
|
|
|
}
|
|
|
assertEquals("Print not retained.", savedPrint, this.print);
|
|
|
},
|
|
@@ -190,13 +194,15 @@ page.testSuite = [
|
|
|
try {
|
|
|
_l.collectPrint(f);
|
|
|
fail("Exception not thrown");
|
|
|
- } catch(ex if ex === undefined) {
|
|
|
-
|
|
|
+ } catch(ex) {
|
|
|
+ if (ex === undefined) {
|
|
|
+
|
|
|
+ } else throw ex;
|
|
|
}
|
|
|
assertEquals("Print not retained.", savedPrint, this.print);
|
|
|
},
|
|
|
|
|
|
- function collectYieldCollectsYieldedArguments() {
|
|
|
+
|
|
|
var collected = _l.collectYield(function() {
|
|
|
yield "Hello";
|
|
|
yield 3;
|
|
@@ -224,8 +230,10 @@ page.testSuite = [
|
|
|
yield "world";
|
|
|
});
|
|
|
fail("Exception not thrown.");
|
|
|
- } catch(ex if ex === "exception") {
|
|
|
-
|
|
|
+ } catch(ex) {
|
|
|
+ if (ex === "exception") {
|
|
|
+
|
|
|
+ } else throw ex;
|
|
|
}
|
|
|
},
|
|
|
|
|
@@ -237,8 +245,10 @@ page.testSuite = [
|
|
|
yield "world";
|
|
|
});
|
|
|
fail("Exception not thrown.");
|
|
|
- } catch(ex if ex === undefined) {
|
|
|
-
|
|
|
+ } catch(ex) {
|
|
|
+ if (ex === undefined) {
|
|
|
+
|
|
|
+ } else throw ex;
|
|
|
}
|
|
|
},
|
|
|
|
|
@@ -253,11 +263,13 @@ page.testSuite = [
|
|
|
} finally { finallyRun = true; }
|
|
|
});
|
|
|
fail("Exception not thrown.");
|
|
|
- } catch(ex if ex === "exception") {
|
|
|
-
|
|
|
+ } catch(ex) {
|
|
|
+ if (ex === "exception") {
|
|
|
+
|
|
|
+ } else throw ex;
|
|
|
}
|
|
|
assertTrue("Finally in f did not run.", finallyRun);
|
|
|
- },
|
|
|
+ },*/
|
|
|
|
|
|
function readonlyReadsCorrectlyAndIsDynamic() {
|
|
|
var x = {hello: "world"};
|
|
@@ -280,7 +292,7 @@ page.testSuite = [
|
|
|
},
|
|
|
|
|
|
function extendExtendsCorrectlyForAllCombinations() {
|
|
|
- var srcProto = { pro: "to" }
|
|
|
+ var srcProto = { pro: "to" };
|
|
|
var src = object(srcProto);
|
|
|
src.a = "b"; src.c = "d";
|
|
|
var dst = { pro: "fi", a: "bc", yes: "true" };
|