Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
1 /*
2 * Any copyright is dedicated to the Public Domain.
3 * http://creativecommons.org/licenses/publicdomain/
4 */
6 /*
7 * Bug 648355: Function.prototype.isGenerator
8 */
10 reportCompare(true, "isGenerator" in Function.prototype, "Function.prototype.isGenerator present");
12 reportCompare(false, (function(){}).isGenerator(), "lambda is not a generator fn");
13 reportCompare(false, Function.prototype.toString.isGenerator(), "native is not a generator fn");
14 reportCompare(false, (function(){with(obj){}}).isGenerator(), "heavyweight is not a generator fn");
15 reportCompare(false, (function(){obj}).isGenerator(), "upvar function is not a generator fn");
17 reportCompare(true, (function(){yield}).isGenerator(), "simple generator fn");
18 reportCompare(true, (function(){with(obj){yield}}).isGenerator(), "heavyweight generator fn");
19 reportCompare(true, (function(){yield; obj}).isGenerator(), "upvar generator fn");
21 reportCompare(false, Function.prototype.isGenerator.call(42), "number is not a generator fn");
22 reportCompare(false, Function.prototype.isGenerator.call({}), "vanilla object is not a generator fn");
23 reportCompare(false, Function.prototype.isGenerator.call(new Date()), "date object is not a generator fn");