Bug 1321222 - Remove legacy generator from js/xpconnect/. r=mrbkap

This commit is contained in:
Tooru Fujisawa 2016-12-01 18:12:14 +09:00
Родитель 5931477b72
Коммит 10515acfd3
2 изменённых файлов: 7 добавлений и 7 удалений

Просмотреть файл

@ -21,7 +21,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=853571
SimpleTest.waitForExplicitFinish();
const Cu = Components.utils;
function mainTest() {
function* mainTest() {
var iwin = $('ifr').contentWindow;
// Test with a simple sandbox with no prototype.
@ -46,9 +46,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=853571
target.addEventListener("message", function listener(event) {
target.removeEventListener("message", listener);
is(event.source, expectedSource, message);
try {
gen.next();
} catch (e if e instanceof StopIteration) {
let {done} = gen.next();
if (done) {
// We're done.
}
});

Просмотреть файл

@ -18,7 +18,9 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=505915
<script type="application/javascript;version=1.7">
/** Test for Bug 505915 **/
window.addEventListener("message", function () { gen.next() }, false);
window.addEventListener("message", function () {
ok(false, "should not receive message");
}, false);
function go() {
var ifr = $('ifr');
@ -36,7 +38,6 @@ function go() {
}
SimpleTest.finish();
yield;
}
SimpleTest.waitForExplicitFinish();
@ -44,7 +45,7 @@ SimpleTest.waitForExplicitFinish();
</script>
</pre>
<iframe id="ifr" onload="gen = go(); gen.next();" src="http://example.org/"></iframe>
<iframe id="ifr" onload="go();" src="http://example.org/"></iframe>
</body>
</html>